select * from TEST_T order by ID_C limit 3;
#0から3つ取り出す。DataBaseではレコードは0からスタート。
select * from TEST_T order by ID_C limit 0,3; select * from TEST_T order by ID_C limit 3,3;
select * from TEST_T order by ID_C limit 3;
#0から3つ取り出す。DataBaseではレコードは0からスタート。
select * from TEST_T order by ID_C limit 0,3; select * from TEST_T order by ID_C limit 3,3;
重複を省く。
select distinct ADD_C from TEST_T;
降順に並べ替え
select * from TEST_T order by ID_C desc;
昇順に並べ替え下記2つとも同じ
select * from TEST_T order by ID_C; select * from TEST_T order by ID_C asc;
insert into TEST_T set ID_C=11;
IDだけ入れてあとはnullの文字NAME_C = nullではだめなので注意。
select * from TEST_T where NAME_C is null; select * from TEST_T where NAME_C is not null;
select フィールド名 from テーブル名; select * from TEST_T; select NAME_C from TEST_T;