Home » SQL & PL/SQL » SQL & PL/SQL » SQL Query (Oracle 10g)
SQL Query [message #347690] Fri, 12 September 2008 18:25 Go to next message
Messages: 32
Registered: March 2005

I have attached a text file having my sql query. This query returns duplicate records. So i need to include 3 more conditions in the this query. Can you tell me how can i apply below conditions in my query:

Conditions are
1. if bk.date_filed and bk.bnkr_type_id same in the records then pick up only one record.
2. if bk.date_filed same in the records but bk.bnkr_type_id different then pick up max(bk.bnkr_type_id) record only.
3. if bk.date_filed different then pick up latest date record only.

where fortracs.bankruptcy bk

I need to do in SQL. Pls let me know if you need any other informations.

  • Attachment: query.txt
    (Size: 8.62KB, Downloaded 139 times)
Re: SQL Query [message #347693 is a reply to message #347690] Fri, 12 September 2008 20:55 Go to previous message
Messages: 24963
Registered: January 2009
Location: SoCal
Senior Member
Please read & FOLLOW the Posting Guidelines as stated in URL above

Without DDL to make your tables, without DML (INSERT) statements provided by you & without specific expected results,
at best what you'll get from here are untested guesses.

Good Luck with taming that monster SQL you posted.

[Updated on: Fri, 12 September 2008 21:27] by Moderator

Report message to a moderator

Previous Topic: Excel Column Name too long
Next Topic: to_date of timestamp field
Goto Forum:

Current Time: Tue Oct 25 09:29:52 CDT 2016

Total time taken to generate the page: 0.14859 seconds