×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Real life SQL Brain teaser (Dave)
Your question is how do I get distinct type and code permutations...
Select type, code, count(*)
From table
Group by type, code
Order by type, code;
The count is immaterial, you get all type distinct type, code combinations...
----------------------------------------------------------------------
message: 1
date: Thu, 19 Nov 2020 14:30:24 +0100
from: Dave <dfx1@xxxxxxxxxxxxxx>
subject: Fwd: Real life SQL Brain teaser
Charles,
That?s amazing but it?s not quite there. If I select the lines where rownbr = 1, I eliminate the list from customer 3, but I also lose the first line from customer 2
cust type code ROWNBR
1 T1 C1 1
1 T3 C2 1
2 T1 C1 2
2 T2 C3 1
2 T3 C4 1
3 T1 C1 3
3 T2 C3 2
3 T3 C4 2
Thanks to everyone else for trying whose solution did not work !
End of MIDRANGE-L Digest, Vol 19, Issue 1670
********************************************
As an Amazon Associate we earn from qualifying purchases.