How to get the first transaction for every unique client? [message #481299] |
Tue, 02 November 2010 06:35 |
pyscho
Messages: 134 Registered: December 2009
|
Senior Member |
|
|
Hi guys, I have a table called pf_stock_txns which just stores all of a clients transactions
If I do select distinct(client_id) from pf_stock_txns then I get back a unqiue list of all clients.
However, I need a query that will give me the first transaction for every unqiue client. any ideas guys?
Thanks
|
|
|
|
|
Re: How to get the first transaction for every unique client? [message #481303 is a reply to message #481302] |
Tue, 02 November 2010 06:52 |
Roachcoach
Messages: 1576 Registered: May 2010 Location: UK
|
Senior Member |
|
|
That will give you a random transaction, you can use rownum like that.
I suspect, and the other folks here will be able to correct me if I'm wrong, all that does is return the first row it finds in the buffer where the ID is 101. As to what is in the buffer and in what order...you've no control over.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|