且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从内部联接中选择不同的行不起作用

更新时间:2023-08-22 19:47:16


我想只得到不同的行。





然后在查询中添加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, …