General Community > Scripting Help

mySQL Query help

(1/2) > >>

Makavelli:
I'm trying to use this select statement but it doesn't seem to work.

------------------
SELECT *
FROM notifications
WHERE notifications.eventID =(SELECT events.eventID FROM events WHERE eventDate < CURRENT_DATE)
------------------

but i'm getting this error:

Error Code : 1064
You have an error in your SQL syntax near 'SELECT events.eventID FROM events WHERE eventDate < CURRENT_DATE)' at line 3

can someone please help?

Zef Hemel:
MySQL does not support subselects for as far as I know.

Michele:
Read up on INNER JOIN and/or LEFT JOIN, that will do what you want.

Spaceman-Spiff:
yup, mysql doesnt support nested queries
you have to nest it in the php part

Makavelli:
alright.. i'll do that. thnx a lot.. at least now i won't go crazy trying to figure it out..   ;D

Navigation

[0] Message Index

[#] Next page

Go to full version