Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
During the script, if I have a table like:
IDRec, IdPers, DataIscr, DataCanc
1 1 01/01/2010 01/03/2010
2 1 01/06/2010
3 2 11/01/2010 21/03/2010
4 3 11/03/2010
5 5 21/01/2011
How can I make the script to extract only one line for each
IdPers, and where there are multiple lines with
the same IdPers value (see IdPers = 1) extract
only the row DataCanc = null?
Thanks to all and hello
Give it a try with the below:
RawData:
LOAD * INLINE [
IDRec, IdPers, DataIscr, DataCanc
1, 1, 01/01/2010, 01/03/2010
2, 1, 01/06/2010
3, 2, 11/01/2010, 21/03/2010
4, 3, 11/03/2010
5, 5, 21/01/2011];
Data:
NOCONCATENATE LOAD
*
RESIDENT
RawData
WHERE
IdPers <> PREVIOUS(IdPers)
ORDER BY
IDRec DESC;
DROP TABLE RawData;
HTH
Peter
Thank Peter, very much.
But why don't I can use an expressin like:
Load *
,firstsortedvalue(dataCanc, -1) as DataCanc2
group by IdPers;
?
Thank All