Re: [RESOLVED]Distinct Help
The GROUP BY will weed out the duplicates.
Re: [RESOLVED]Distinct Help
Both examples worked for me. So i'm happy
Re: [RESOLVED]Distinct Help
Quote:
Originally Posted by Hack
The GROUP BY will weed out the duplicates.
hack still i am confused how Group by query will give 1234 & 2222 :confused:
should't it should be
Code:
Select Left(Ref,4) from Table
GROUP BY Left(Ref,4)
or
Code:
Select DISTINCT Left(Ref,4) from Table
GROUP BY ref
:blush:
Re: [RESOLVED]Distinct Help
I have just looked at Hacks orignal post, I added the DISTINCT before the left command.
Code:
Select DISTINCT Left(Ref,4) from Table GROUP BY Ref
Re: [RESOLVED]Distinct Help
Quote:
Originally Posted by drawlings
I have just looked at Hacks orignal post, I added the DISTINCT before the left command.
Code:
Select DISTINCT Left(Ref,4) from Table GROUP BY Ref
you already have DISTINCT clause so dont use Group by as it will be sort of overkilling your query ;)
Re: [RESOLVED]Distinct Help
Thanks mate, will remove the Group By Clause