Simon wrote:
Hi all,
Have been trying to get the syntax of a delete query in MySQL for days
and get nothing but errors. Any MySQL Gurus out there can help? I have
tried all the versions and variations I can find on the web site, this
is V3 of MYSQL. I either get a syntax error and the query seems to be
truncated or I get an invalid table name. I have tried standard SQL
syntax, have tried the 'USING' command etc etc. Any ideas?
Table 1: user
Table 2: user_preferences
I want to delete records from the user-preferences table based on a
field 'department' in the user table being '2000'
The table can be joined from user.id=user_preferences_userid
With MySQL v3 there is no multi table delete nor subqueries. You have to
do it in multiple statements or upgrade to at least v4 of MySQL.
Fil
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html