
求助问题
站在最高处呐喊的男人!
租房请下载:房东直租APP
展开
-
同一张表两次查询结果集合并
情境:select a.czsj,a.czje,b.jzsj,b.jzje from(select a.* from table where a.jdbz = '左' and id = 22992)afull join (如果添加full报错,请去掉,不过注意添加on条件)(select b.* from table where b.jdbz = "右" and id = 229...原创 2017-08-21 10:54:51 · 12422 阅读 · 4 评论 -
在一张表中过滤出同一张卡号对应多个户名数据
今天突然发现一个貌似相仿的例子,在此记录。select lxdh,kh,zhkhmc,khrzjhm from table where id = 666 and lxdh is not nulland lxdh in(select lxdh from table where id = 666and lxdh is not null and khrzjhm is not null原创 2017-08-24 09:48:47 · 1021 阅读 · 0 评论 -
同一张表中将去重的数量展示
下午事情比较多,我就简短的记录一下。今天遇到一种处理sql的情况如果是获得去重某字段的数量并且展示select a,count(a) from table group by a但是呢,我需要在这张表中展示的字段比较多,如果全部添加到group by中,出来的结果是不正确的。select b,c,d,e,a,count(a) from table group by b,c,d,e原创 2017-09-08 14:48:55 · 977 阅读 · 0 评论