SQL勉強 SELECT構文
2021.10.28
SQLの勉強始めます。今回はSELECT構文について勉強します。 コードだけひたすら書いていきます。
sql
SELECT column_name FROM table_name WHERE column_x = 'AAA'
sql
SELECT column_a, column_b FROM table_name WHERE column_x IN ('AAA', 'BBB', 'CCC')
sql
SELECT column_a, column_b FROM table_name WHERE column_x >= 1111
sql
SELECT column_a, column_b FROM table_name WHERE column_x BETWEEN 0 AND 10000
sql
SELECT column_a, column_b FROM table_name WHERE column_x LIKE 'A%' ORDER BY column_y
sql
SELECT column_a, column_b
FROM table_name
INNER JOIN (SELECT xxx FROM xxxx GROUP BY xxxx HAVING count(*) > 1) A
ON table_name.id = A.id