Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using WHERE fieldName IN... 1

Status
Not open for further replies.

XgrinderX

Programmer
Mar 27, 2001
225
US
I cannot get the following query to run:

SELECT * FROM tblMessages WHERE iMessageID IN (SELECT iMessageID FROM tblMessageTo WHERE iUserID = 1) AND iFolderID = 1 ORDER BY dtSent DESC

I can execute queries like this all day long in MS SQL, what am I doing wrong?

-Greg
 
Sub-queries are supported in MySQL from version 4.1 onwards. Maybe you are using an earlier version.

It should be possible to rephrase that query as a join.
 
UGH! You're right. We have version 4.0.18. I am a total rookie with MySQL installations - can I just download the new version and install it over the top of the one we have?
 
That should be no problem. The table formats are the same, as far as I remember.
 
I got it done, upgraded to 4.1.13 and now it's all happy! Thanks so much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top