Marc Antony Vose writes:
> Hey there.
>
> This may be an elementary question, and if so, I apologize, but I can't
> seem to find a reference to it in my book or the MySQL manual. I'm new at
> SQL.
>
> I'm running a games site off MySQL, and I've got three tables: games,
> hardware and utilities.
>
> I want to query all three tables at once and return "upcoming products".
> The problem is, I need to distinguish between games, hardware and
> utilities, but I want it in one list.
>
> So, I'd like it to return the table name along with each row, like so:
>
> name table
>
> Baseball games
> Blah Blah utilities
> Joystick X hardware
> Quake games
>
> Is this possible?
>
> Cheers.
>
>
> Marc Antony Vose
> Founder, Mac Game Database
> http://www.gamedb.com/
>
Hi!
No, it is not possible, you must have three queries. In any SQL the
same field name, like 'name', used by three table would in a single
query produce 'ambiguous field name' error.
Sinisa
+---------------------------------------------------------------------+
| TcX ____ __ _____ _____ ___ == mysql@stripped |
| /*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Sinisa Milivojevic |
| /*/ /*/ /*/ \*\_ |*| |*||*| mailto:sinisa@stripped |
| /*/ /*/ /*/\*\/*/ \*\|*| |*||*| Belgrade |
| /*/ /*/ /*/\*\_/*/ \*\_/*/ |*|_____ Serbia |
| ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^ |
| /*/ \*\ Developers Team |
+---------------------------------------------------------------------+