IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

What will be the effect of the given SQL Query


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
morfius9
Warnings : 1

New User


Joined: 22 Feb 2006
Posts: 27

PostPosted: Thu Nov 30, 2006 2:18 pm
Reply with quote

What will the below query achieve?

Delete from A
Where exists
(Select 'F' from B
where B.date = current date)

WARNING: Do not use 'URGENT' in Title
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Thu Nov 30, 2006 2:39 pm
Reply with quote

Hi morfius9,

I think it will delete all the row of table A

Corrections r welcome
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Canada

PostPosted: Thu Nov 30, 2006 8:19 pm
Reply with quote

Hi,
In order to delete all the rows of table A the exist should have atleast one row selected from table B.If no row is selected ,then there will be no delete.

Correct me if i am wrong.

Regards,
Muthuvel.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Thu Nov 30, 2006 8:59 pm
Reply with quote

Hi Muthuwel.

Thanks for correcting me
Back to top
View user's profile Send private message
morfius9
Warnings : 1

New User


Joined: 22 Feb 2006
Posts: 27

PostPosted: Mon Dec 04, 2006 1:33 pm
Reply with quote

Thanks Guys, I appreciate the help
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Issue with EXEC CICS QUERY SECURITY c... CICS 6
Search our Forums:

Back to Top