2011-05-24から1日間の記事一覧

カウントの結果を条件に含める

SQL

HAVINGでおk SELECT customer.*, COUNT(customer_user.id__customer) AS COUNT__customer_user FROM customer LEFT JOIN customer_user ON customer.id = customer_user.id__customer GROUP BY customer.id HAVING 0 < COUNT__customer_user

セレクトボックスで選択されている値を取得

よく忘れるのでメモ。 alert( document.getElementById("hoge").options[ document.getElementById("hoge").selectedIndex ].value );