Hi,
I am selecting multiple records from table and joining them.
My query is like this,
SELECT B.ace AS Column1
K.lastname +' '+ K.firstname AS Column2,
R.inside AS Column3,
B.number AS Column4
from Btable B
left join Ktable K
on B.id= K.id
left join Other O
on B.number=O.othernumber
left join Rtable R
on O.somenumber=R.rnumber
GROUP BY
B.ace,
K.lastname +' '+ K.firstname,
R.inside
B.number
I want to select distinct records of "K.lastname +' '+ K.firstname" and "R.inside".
I tried giving (SELECT DISTINCT K.lastname +' '+ K.firstname AS Column 2)
but it didn't work. Is there a way to do this?
Thanks