![]() |
|||||||||
![]() |
![]() |
SQL の変更点
* postgres [#e092ed8c] ** select [#pbce5c5e] select * from [table] where [colomn] is null; select * from [table] where [colomn] is not null; select * from [table] where [colomn] like '%hoge%'; select * from [table] where [colomn] not like '%hoge%'; ** 重複削除 [#df759b04] delete from 【TABLE】 where 【ID】 in (select 【ID】 from 【TABLE】 S1 where 【ID】< (select MAX(【ID】) from 【table】 as S2 where S1.key1=S2.key1 and S1.key2=S2.key2 ..... ) ) ; * psql 編 [#s35635dc] *** psql [#pa3a5376] psql [-h 【hostname】] -d 【dbname】 *** backup [#n8e33415] pg_dump 【dbname】 > dbname.dump *** 復活 [#pce621dd] psql -d 【dbname】 -f dbname.dump *** 重複検索 [#l38dd420] select min(id) from item where type=100 group by time,geom having count(*) > 1 select min(id) from item group by time having count(*) > 1 |
|||||||