SQL勉強 SELECT構文
2021.10.28
SQLの勉強始めます。今回はSELECT構文について勉強します。
コードだけひたすら書いていきます。
sqlSELECT column_name FROM table_name WHERE column_x = 'AAA'
sqlSELECT column_a, column_b FROM table_name WHERE column_x IN ('AAA', 'BBB', 'CCC')
sqlSELECT column_a, column_b FROM table_name WHERE column_x >= 1111
sqlSELECT column_a, column_b FROM table_name WHERE column_x BETWEEN 0 AND 10000
sqlSELECT column_a, column_b FROM table_name WHERE column_x LIKE 'A%' ORDER BY column_y
sqlSELECT 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