tableからlistの行を取り出し
select list from table;
table から全ての行を取り出し
select * from table;
select cat,a + b from table;
a と b は数値型と仮定する。
select 100 * 200;
電卓として使用できる
select random();
random()という関数を呼び出す。
select * from table1,table2
select * from table1 cross join table2;
クロス結合
select * from table1 inner join table2 on true;
select * from table1 cross join table2;
select * from table1 inner join table2 on table1.number = table2.number;
select * from table1 inner join table2 using (number);
カラムnumber をキーにして、結合
select * from table1 natural inner join table2;
naturalはusingの略式です。
select * from table1 left join table2 on table1.number = table2.number;
select * from table1 left join table2 using (number);
select * from table1 right join table2 on table1.number = table2.number;
select * from table1 full join table2 on table1.number = table2.number;
select list from table;
table から全ての行を取り出し
select * from table;
select cat,a + b from table;
a と b は数値型と仮定する。
select 100 * 200;
電卓として使用できる
select random();
random()という関数を呼び出す。
select * from table1,table2
select * from table1 cross join table2;
クロス結合
select * from table1 inner join table2 on true;
select * from table1 cross join table2;
select * from table1 inner join table2 on table1.number = table2.number;
select * from table1 inner join table2 using (number);
カラムnumber をキーにして、結合
select * from table1 natural inner join table2;
naturalはusingの略式です。
select * from table1 left join table2 on table1.number = table2.number;
select * from table1 left join table2 using (number);
select * from table1 right join table2 on table1.number = table2.number;
select * from table1 full join table2 on table1.number = table2.number;
PR
INDEX
- Mysql ハードディスク故障時 データデース 抜き取りの方法
- SQL TO_NUMBER関数
- SQL CONCAT関数 SQLのCONCAT関数について
- SQL ALTER SQLのALTERとは
- SQL SUM関数 合計値
- SQL AVG関数 平均値
- sql コマンド ネスト 関数 使用
- sql コマンド COALESCE関数 NULL値 処理
- sql コマンド NULLIF関数 null値 処理
- sql コマンド NVL関数 null値 処理
- sql コマンド case decode関数 使用
- sql コマンド DISTINCT SELECT 重複行 削除
- sql コマンド group by グループ化
- postgres sql 部分インデックス
- sql コマンド データ 並び替えORDER BY
- sql help テーブル 列 別名 as
- create テーブル作成
- postgres ログイン 方法 データベース接続 方法
- select as 別名
- select 問い合わせ postgres ①
