从内部联接中选择不同的行不起作用 [英] Selet distinct rows from inner join not working

查看:64
本文介绍了从内部联接中选择不同的行不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我的查询下面有重复的行:


选择count(*)作为count,a。 coulmn1,column2,a.column3 from table a inner join table b on a.column3 = b.column1其中a.cloumn4 ='some date'group by a.column1,column2,a.column3 order by a.column1,column2;


我想只得到不同的行。任何人都可以帮忙。




解决方案


我想只得到不同的行。





然后在查询中添加DISTINCT

选择 DISTINCT 计数(*)作为计数,a.coulmn1,column2,... 


Hi,

I have the query below which has duplicates rows:

Select count(*) as count,a.coulmn1, column2, a.column3 from table a inner join table b on a.column3 = b.column1 where a.cloumn4 = 'some date' group by a.column1, column2, a.column3 order by a.column1, column2;

I want to get only the distinct rows. Can anyone please help.

解决方案

I want to get only the distinct rows.

Then add a DISTINCT to your query

Select DISTINCT count(*) as count,a.coulmn1, column2, …


这篇关于从内部联接中选择不同的行不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆