>Hi there,
>
>I'm using mysql 3.22.27 and get error when trying to run this select
>statement:
>
>SELECT custmls.mlsnumber,custmls.streetnumber,custmls.streetdirect,
>FORMAT(custmls.currentprice,0),custmls.streetnam,custmls.streetaddtl,
>custmls.municname,custmls.state,custmls.zipcd,custmls.salesassoc,
>ipix.url,custmls.listagentname,FORMAT(custmls.numrooms,0),
>FORMAT(custmls.numbedrooms,0),custmls.fullbaths
>FROM custmls,ipix where custmls.mlsnumber = ipix.mlsnumber AND
>custmls.listingoffice = 0251 AND
>(custmls.listingstatus = 'ACT' or custmls.listingstatus = 'A*') AND
>custmls.scategory = 1 ORDER BY custmls.currentprice
>
>The error is: "1064 You have an error in your SQL syntax near 'ON ipix
>custmls.mlsnumber = ipix.mlsnumber where custmls.listingoffice = 0251 AN' at
>line 1 "
>
>Any ideas?
>
>Thanks
>
>Pat
Sir, the error message was obviously from an SQL statement other than
the one you quote above.
Since I don't know your table structure, I can't be sure what the
problem is, but it looks like you are writing columns and tables as
table_name.column_name. This is backwards. It should be
column_name.table_name. The alternative is that you are selecting
from a boat load of tables that aren't mentioned in the FROM clause.
I see two problems with the snippet of SQL quoted in the error
message. First of all, the word 'ipix' after ON isn't serving any
function, other than to confuse MySQL. Secondly, you are trying to
join two tables, but your ON clause joins a column from mlsnumber to
another column from mlsnumber. If this is not the error mentioned
above, then you need to join a column in mlsnumber to a column in the
second table.
Bob Hall
Know thyself? Absurd direction!
Bubbles bear no introspection. -Khushhal Khan Khatak
MySQL list magic words: sql query database
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php