Change the query to:

SELECT parcels.DXF as 'record',
building.ADDRESS as 'results1', parcels.relname as
'results2' from  parcels INNER JOIN building
on parcels.DXF = building.DXF where
parcels.relname LIKE '%jones%' order by
parcels.relname desc;

For tables in the from list, the next word after a table name is considered to be the 
alias, unless it is a keyword.  So, when you had: 
"from  parcels building INNER JOIN building as building"
since building was immediately after parcels, it thought you wanted to use building as 
an alias for parcels.  You then go on to list building, so according to your query you 
wanted parcels aliased as building, and building also to be called building, so there 
was a conflict.  

-----Original Message-----
From: Diver8 [mailto:[EMAIL PROTECTED]
Sent: Monday, February 24, 2003 10:47 AM
To: [EMAIL PROTECTED]
Subject: Unknown table in field list


Hi again.

I've tried searching the list archives for this all
morning, but they don't seem to be working (never get
any results, page times out).  I found one report of
this on google but the guy said he figured out the
problem but didn't say what he did to fix it!

I just added a table to my database (about four hours
ago, actually).  This table is called 'building'.  My
overall database looks like this:

mysql> show tables;
+------------------------+
| Tables_in_tmp_db_work  |
+------------------------+
| building               |
| parcels                |
+------------------------+
2 rows in set (0.00 sec)

I'm trying to run the following query:

mysql> SELECT parcels.DXF as 'record',
building.ADDRESS as 'results1', parcels.relname as
'results2' from parcels where parcels.relname like
'%jones%' order by parcels.relname desc;

That query returns:

ERROR 1109: Unknown table 'building' in field list

If I try this query instead:

mysql> SELECT parcels.DXF as 'record',
building.ADDRESS as 'results1', parcels.relname as
'results2' from  parcels building INNER JOIN building
as building on parcels.DXF = building.DXF where
parcels.relname LIKE '%jones%' order by
parcels.relname desc;

The query returns:

ERROR 1066: Not unique table/alias: 'building'

So what's wrong??

Thanks.



__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

---------------------------------------------------------------------
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


---------------------------------------------------------------------
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

Reply via email to