ΥڡϤƤʥ֥åޡɲΥڡޤϤƤʥ֥åޡ Υڡlivedoor åפɲΥڡޤlivedoor å

HAVING

  • HAVINGˤƽ״ؿޤPꤹ뤳Ȥǡ״ؿη̤Ȥʹߤ򤹤Ȥ˻Ȥ
    • ״ؿޤPWHEREˤϵҤǤʤ
    • ĤޤꡢGROUP BYȥåȤǻȤ뤳Ȥ¿
  • HAVVINGɡܾPפΤȤHAVINGȤ
  • HAVINGɤθˤɬPꤹ롣

㡧󥱡Ȳơ֥questˤƻܸȤɾǡʿѤ2̤ΥǡФ

> SELECT prefecture, AVG(answer) AS ɾʿ FROM quest GROUP BY prefecture HAVING AVG(answer) < 2;

㡧롼פιͤ100ʾǤ륰롼פ̤ȤƼФ

> SELECT x, SUM(i) FROM foo GROUP BY x HAVING SUM(i) > 100;

ޤHAVINGʬǹͤ롣

> SELECT x, SUM(i) FROM foo GROUP BY x;

xǥ롼ײxȹͤ2ФФHAVINGŬѤΤǡͤ100ʾΤΤФ櫓Ǥ롣

ʸ

  • []SQLݥåȥե󥹡