I’m new to mysql and I’ve been having problems with this query.
Consider this query:
SELECT a.group_message_id, a.scheduled_date, b.message, c.phone_number, d.group_name
FROM schedule AS a
JOIN group_message AS b ON a.group_message_id = b.id,
JOIN phonenumber AS c ON c.id = a.phonenumber_id,
JOIN group_table AS d ON d.group_id = a.group_id
WHERE a.status = 'unsent'
And this error message:
You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near ‘JOIN phonenumber AS c ON c.id = a.phonenumber_id, JOIN
group_table AS d ‘ at line 4
I need help with what’s actually wrong with the statement. Also I would really appreciate it if you can show me other and “proper” ways of doing such.
Lastly, provided that there’s not enough time, is there an effective resource that I can learn from at least the basics of mysql. Please share.
remove the comma on join statements,
final query,