Distinct records problem
-
-
Hi , I want to read the distinct records with multiple columns. for example, tableA -------- OID CODE 1 READ 2 READ 3 WRITE 4 WRITE select distinct CODE, OID from tableA it gives, READ 1 READ 2 WRITE 3 WRITE 4 but expected result was, READ 1 WRITE 3
-
Hi , I want to read the distinct records with multiple columns. for example, tableA -------- OID CODE 1 READ 2 READ 3 WRITE 4 WRITE select distinct CODE, OID from tableA it gives, READ 1 READ 2 WRITE 3 WRITE 4 but expected result was, READ 1 WRITE 3
hmm not sure exactly what your looking for so I'm going to assume you want: the lowest OID for each distinct CODE which is: select CODE, MIN(OID) from tableA group by CODE which would give your desired result. DISTINCT is no way appropriate for what your trying to do in this case!
-
hmm not sure exactly what your looking for so I'm going to assume you want: the lowest OID for each distinct CODE which is: select CODE, MIN(OID) from tableA group by CODE which would give your desired result. DISTINCT is no way appropriate for what your trying to do in this case!
-
don't assume you have OID in number format OID CODE x READ y READ z WRITE .. this scenorio expected result will be, OID CODE x READ z WRITE
if you didn't want us to assume , then you should have stated clearly in your orig post, instead of wasting our time................. dunderhead
-
don't assume you have OID in number format OID CODE x READ y READ z WRITE .. this scenorio expected result will be, OID CODE x READ z WRITE