Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
from a table with the following structure i need to extract only one record per value of a certain field.
Table:
A | B | C |
---|---|---|
Value1 | ABC | Test1 |
Value1 | DEF | Test1 |
Value1 | GHI | Test1 |
Value1 | JKL | Test2 |
Value1 | MNO | Test2 |
Value2 | KLL | Test1 |
Value2 | PPQ | Test1 |
Value2 | JJN | Test2 |
Value2 | BBS | Test2 |
What i want: For each value in A and C i want to extract ONE record (no matter which record). The result could look something like this:
A | B | C |
---|---|---|
Value1 | ABC | Test1 |
Value1 | JKL | Test2 |
Value2 | PPQ | Test1 |
Value2 | BBS | Test2 |
Hope, my problem is clear & thanks a lot for some advise.
regards.K
Something like this:
LOAD
A,
minstring(B) as B,
C
FROM
DATASOURCE
group by A, C;
?
Hi,
Try this
LOAD
A,
C,
Max(B) AS B
FROM DataSource
GROUP BY A, C;
Regards,
Jagan.
it ll work fine.