摘要:
1,查询存在一个表,而不在另一个表中的数据记录 select * from A where not exists(select 1 from B where A.ID=B.ID) 2,hhere 和 having 涉及到对分组结果集的过滤操作,都用having,having子句中可以直接使用聚合函数 阅读全文
摘要:
1,将空字段转换为0 isnull(字段名,0) 2,case 。。。when SELECT a,b,c, (case d when 1 then '!' when 2 then '@' else '~' end) t from table; 3,将数据转为字符类型:concat 例:转为百分比 C 阅读全文
摘要:
SELECT: select * from table select 列名 from table select DISTINCT 列名 from table INSERT: insert into table values('','','',''...) insert into table(列,列. 阅读全文