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
select userinfo.*
from userinfo
inner
join encryptfunction
on userinfo.encfunctionId
= encryptfunction.encfunctionid
where encryptfunction.encfunctionname = 'sha1'