Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Can u help to build a Query.....

Re: Can u help to build a Query.....

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Fri, 14 Jul 2006 19:16:28 +0200
Message-ID: <44b7d16c$0$689$626a54ce@news.free.fr>

"krisworld" <krishnamurthy.iyer_at_gmail.com> a écrit dans le message de news: 1152896667.223298.147730_at_b28g2000cwb.googlegroups.com...
| Hello
|
| i have a table
| Let say it has 5 fields say F1,F2,F3,F4,F5
| the field 5 i.e F5 shall have value either 0 or 1
|
| Let say it has some records some this like this.....
|
| F1 F2 F3 F4 F5
| -------------------------------
| a b c d 0 (Record 1)
| a b c d 1 (Record 2)
| m n o p 0
| m n o p 1
|
| I require to have a query which shall check the first field and last
| field for comparison
| that is
| if F1 of Record 1 = F1 of Record 2 and F5 of Record 1 =0 and F5 of
| Record 2=1
| then should compare rest of the fields i.e F2 F3 F4
| such as..
| IF F2 of Record 1 <> F2 of Record 2 or F3 of Record 1 <> F3 of Record 2
| or F3 of Record 1 <> F3 of Record 2
|
| the query should pass me the whole field i.e F1 F2 F3 F4 F5
| In other words fetch only records which has a difference.
|
| I hope i have made the problem clear.
| I don't know if this is possible or not, but i shall appreciate if any
| one can help me
| Thanks and Regards
| Kris
|

You can build your query with the LAG function.

http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/functions070.htm#i1327527

Regards
Michel Cadot Received on Fri Jul 14 2006 - 12:16:28 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US