DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   MySQL (http://www.daniweb.com/forums/forum126.html)
-   -   how to write nested queries in a function (http://www.daniweb.com/forums/thread116765.html)

ratnasatish Apr 1st, 2008 7:17 am
how to write nested queries in a function
 
how to write nested queries
ex:
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.

phper Apr 1st, 2008 5:21 pm
Re: how to write nested queries in a function
 
Your not really specifiying anything in your where clause. Is the value taken from table2 equal to, not equal to, less than, etc.

RoryGren Apr 3rd, 2008 3:25 pm
Re: how to write nested queries in a function
 
That query you have should work. I have just tried it on one of my databases and it ran with no problems.


All times are GMT -4. The time now is 1:43 am.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC