update table01 set name='msq_all' where id=122;
--更新数据

insert into table01(id,dmcode,name,month) values (122,1,'app_all',201706) ;
--插入数据

SELECT * FROM table01 where 1=1 ORDER BY  app_name,flag asc/desc ;
--查询数据并且排序

select * from persons limit 5 offset 0;
--查询起点0开始查询,返回5条数据

ORDER BY colname DESC NULLS FIRST / LAST;
--排序并且指定某数据排第一或最后

SELECT *,
(CASE WHEN province_type='省内'THEN 0 ELSE 1 END ) sn 
FROM 
table009 where 1=1 
ORDER BY  
CASE WHEN id='全省' and type='省内'  THEN 0 ELSE 1  END,sn;
--case...when..then...else... end

delete from table009 where id='11';--删除数据

 

相关文章:

  • 2022-12-23
  • 2021-07-09
  • 2021-10-19
  • 2021-11-14
  • 2022-12-23
  • 2022-12-23
  • 2021-10-08
  • 2021-04-22
猜你喜欢
  • 2022-01-31
  • 2022-12-23
  • 2021-12-27
  • 2022-02-12
  • 2021-11-14
  • 2021-07-06
  • 2021-12-05
相关资源
相似解决方案