I want to use nested queries in MySQL. is it possible. i have MySQL version 4.0.12.
and if it does then why the following query is not working
select * from userinfo where encfunctionId='(select encfunctionid from encryptfunction where encfunctionname="sha1")'
IF this version does not provide then is it wise to write code using sub queries assuming all hosts would be using mysql 4.1 or should i write code according to 4.0 versions
its just a testing query but it isn’t working.
thanks for your time
subselects such as that one can always be written as joins
where encryptfunction.encfunctionname = 'sha1'
oh so both are same eh… i thought there is some advantage writing in nested select statements. IS IT TRUE??
thanks for your answer
as you can imagine, the number of different types of subquery is large
some of them are easier to understand as joins, some are not
if you wish to delve into this a bit deeper, here’s an article: How to Misuse SQL’s FROM Clause
Thanks r937. it was really helpful.