笔者日常工作中常用到的sql语句,现总结如下,留作日后查看. 1.按照两列中的最大值取 ,只取两列其中的一列 SELECT * FROM t_doc T ORDER BY GREATEST(T.Load_Count,T.Read_Count) desc 2.取两列之和 select t.*,(nvl(T.Load_Count,0)+nvl(T.Read_Count,0 )) as c FROM t_doc T order by c desc 3.取两列字符串连接 select T.Load_Co…
-- 查询所有数据 SELECT * FROM [TABLE_NAME]; -- 查询数据总量 SELECT COUNT(*) AS COUNT FROM [TABLE_NAME]; -- 清空表内所有数据 ALL_DATA. DELETE FROM [TABLE_NAME]; -- 清空表内指定参数的行级数据. DELETE [TABLE_NAME] WHERE [COLUMN_NAME] = '[指定参数]' DELETE FROM [TABLE_NAME] WHERE [COLUMN_NA…