SELECT文
テーブルからデータ行を得る
<構文> SELECT condition FROM table_name;
SQL> SELECT A1, A2 FROM TEST050118 2 WHERE KEY00 >= 3;A1 A2 -------------------- ---------------- Test3 05-05-31 Test4 05-03-29 Test5 05-07-07SQL>
ORDER BY 句
SQL> SELECT * FROM TEST050118 2 ORDER BY KEY00 ASC;KEY00 A1 A2 A3 A4 --------- -------------------- ---------------- --------- --------- 1 Test1 05-05-31 1 2 2 Test2 05-05-31 10 20 3 Test3 05-05-31 100 200 4 Test4 05-03-29 1000 2000 5 Test5 05-07-07 10000 20000SQL> SQL> SELECT * FROM TEST050118 2 ORDER BY KEY00 DESC;KEY00 A1 A2 A3 A4 --------- -------------------- ---------------- --------- --------- 5 Test5 05-07-07 10000 20000 4 Test4 05-03-29 1000 2000 3 Test3 05-05-31 100 200 2 Test2 05-05-31 10 20 1 Test1 05-05-31 1 2SQL>
COUNT 関数
SQL> SELECT COUNT(*) FROM test050118; COUNT(*) --------- 5 SQL>