Home » SQL & PL/SQL » SQL & PL/SQL » sql query logic (oracle 10g)
sql query logic [message #610677] Sat, 22 March 2014 13:30 Go to next message
cvasi555
Messages: 3
Registered: March 2014
Junior Member
Hi All,

I need sql queryrio to get solution for below scneario

Iam having two tables

DEPT1
===
10
20
30
40

DEPT2
=====
20
40

Output should be as below ( rows which are not present in second table)

====

10
20
Re: sql query logic [message #610678 is a reply to message #610677] Sat, 22 March 2014 13:33 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Welcome to this forum.

Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/ and please read http://www.orafaq.com/forum/t/174502/102589/


Read The Fine Manual below
http://docs.oracle.com/cd/E16655_01/server.121/e17209/queries004.htm#SQLRF52347
Re: sql query logic [message #610682 is a reply to message #610678] Sat, 22 March 2014 13:42 Go to previous messageGo to next message
cvasi555
Messages: 3
Registered: March 2014
Junior Member
Thanks for you reply.
Can i use MINUS operator for my requirement
Re: sql query logic [message #610683 is a reply to message #610682] Sat, 22 March 2014 13:44 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>Can i use MINUS operator for my requirement
I give up.
Can you?

what happens when you try it?

Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/
Re: sql query logic [message #610686 is a reply to message #610677] Sat, 22 March 2014 14:39 Go to previous messageGo to next message
Michel Cadot
Messages: 68643
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Quote:
Output should be as below ( rows which are not present in second table)

====

10
20


20 IS in the second table.

Re: sql query logic [message #610694 is a reply to message #610686] Sat, 22 March 2014 21:01 Go to previous messageGo to next message
cvasi555
Messages: 3
Registered: March 2014
Junior Member
The final output should be as below

Ouput
=====
10
30
Re: sql query logic [message #610695 is a reply to message #610694] Sat, 22 March 2014 21:44 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Please read and FOLLOW the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/
Re: sql query logic [message #610696 is a reply to message #610682] Sun, 23 March 2014 01:04 Go to previous message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
cvasi555 wrote on Sat, 22 March 2014 19:42

Can i use MINUS operator for my requirement


It's been almost 12 hours since you said then, but it appears that you still didn't try it. Why?
Previous Topic: count rows grouped by column name
Next Topic: update rows based on column values
Goto Forum:
  


Current Time: Tue Apr 23 11:32:48 CDT 2024