User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 422,388 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,720 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 701 | Replies: 2
Reply
Join Date: Mar 2008
Posts: 5
Reputation: ratnasatish is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
ratnasatish ratnasatish is offline Offline
Newbie Poster

how to write nested queries in a function

  #1  
Apr 1st, 2008
how to write nested queries
ex:
  1. SELECT * FROM [table1] WHERE [COLUMN] IN (SELECT [COLUMN] FROM [table2])

in a function.

i tried this but MYSQL is getting stoped.
is there any alternate.
Last edited by peter_budo : Apr 1st, 2008 at 7:19 am. Reason: Keep It Organized - please use [code] tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2006
Location: South Wales
Posts: 159
Reputation: phper is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 11
phper's Avatar
phper phper is offline Offline
Junior Poster

Re: how to write nested queries in a function

  #2  
Apr 1st, 2008
Your not really specifiying anything in your where clause. Is the value taken from table2 equal to, not equal to, less than, etc.
If you find my post useful please add to my reputation!! Thanks!

ajtrichards web solutions
http://www.ajtrichards.co.uk
Reply With Quote  
Join Date: Oct 2007
Location: South Africa
Posts: 60
Reputation: RoryGren is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 7
RoryGren's Avatar
RoryGren RoryGren is offline Offline
Junior Poster in Training

Re: how to write nested queries in a function

  #3  
Apr 3rd, 2008
That query you have should work. I have just tried it on one of my databases and it ran with no problems.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MySQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the MySQL Forum

All times are GMT -4. The time now is 8:50 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC