Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> SQL Question
Hi SQL Gurus,
I have problem in getting the following results. Any help will appreciated. I have a table like
STOCK_TABLE
stock_no dealer_no received_datesame dealer on the same day more than once. i.e. the result of the above sample data would be
__________ _________ ______________
1000 A111 12-JAN-97 2000 A111 12-JAN-97 3000 A222 13-JAN-97 4000 A333 14-JAN-97 5000 A333 14-JAN-97 I want to find all the stock_no where I received that stock from the
stock_no dealer_no received_date
__________ _________ ______________
1000 A111 12-JAN-97 2000 A111 12-JAN-97 4000 A333 14-JAN-97 5000 A333 14-JAN-97
By following sql I can get the dealer_no and received_date but not the stock_no.
SELECT dealear_no, received_date FROM stock_table GROUP BY dealear_no, received_date HAVING count(*) > 1 this will get dealer_no received_date _________ _____________ A111 12-JAN-97 A333 14-JAN-97 Any help will be appreciated. Thank you,
Prabha.
-------------------==== Posted via Deja News ====----------------------- http://www.dejanews.com/ Search, Read, Post to UsenetReceived on Wed Aug 27 1997 - 00:00:00 CDT