Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Equalent to Oracle

Author  Topic 

CSK
Constraint Violating Yak Guru

489 Posts

Posted - 2006-11-28 : 01:05:57
What is the Equalent query in Oracle for The Following SQl Query..?

If Not Exists ( Select 'x' from Tbl a Where col = @Col
and exists ( Select 'x' from tblb b WHere b.Col =A.col))

Can any one able to help me to do this in oracle..!

krishnakumar.C

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-11-28 : 01:11:31
Same syntax in SQL Server.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

CSK
Constraint Violating Yak Guru

489 Posts

Posted - 2006-11-28 : 01:33:19
THanks peter, But it returns the error like Incorrect syntax near "IF"

I write The Same SQL syntax to oracle. It's working in sql But Not Working In Oracle

Krishnakuamr.C
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-11-28 : 01:37:15
If Not Exists ( Select * from Tbl Where col = @Col)
and exists ( Select * from tblb b inner join tbl a on b.Col = a.col)


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-11-28 : 01:49:53
This Works... in SQL Server 2000

If Not Exists (
Select 'x' from Tbl a Where col = @Col
and exists (
Select 'x' from tblb b WHere b.Col =A.col
)
)
Print 1
Else
Print 2


Where Exactly you are trying to you this ?

Chirag

http://chirikworld.blogspot.com/
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-11-28 : 01:57:23
quote:
Originally posted by CSK

I write The Same SQL syntax to oracle. It's working in sql But Not Working In Oracle

Oh! You want the same query in ORACLE?
This is not the right forum for you...


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-11-28 : 02:04:35
Good Catch Peter... :-)

CSK, try
www.dbforums.com

Chirag

http://chirikworld.blogspot.com/
Go to Top of Page

CSK
Constraint Violating Yak Guru

489 Posts

Posted - 2006-11-28 : 02:10:27
Thanks Peter, chiragkhabaria

Krishnakuamr.C

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-11-28 : 09:08:19
Post Oracle related questions at www.DBForums.com or www.ORAFAQ.com

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -