sql server instructions help 入門 sponsored link


postgres の最近のブログ記事

postgres ★SQL★ 部分インデックス

部分インデックスとは、
テーブルの部分集合に構築されるインデックスです。

※インデックスとは、
インデックスとは、
データの検索速度を向上させるために、
どの行がどこにあるかを示した索引のことです。
データを検索するときに、
目的のデータが見つかるまですべての行を一行ずつ調べていくのをやめて、、
索引を利用して目的の行の場所を見つけてから
その行のデータを読み取る。

create index
ログイン方法

①postgres ユーザになる。
$ su - postgres

②データベースに接続
$ psql db1

db1=# と出ればデータベースへの接続は完了
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;














Buzzurl/ hatena/ MyYahoo!/ livedoorClip/ Google/ niftyclip/ pookmark/ flog/ FC2/

category

SQL


<<select>>
banner_14.gif

<<SQL>>
banner_14.gif

<<sql distinct>>
banner_14.gif

ブログランキング