List:General Discussion« Previous MessageNext Message »
From:Thimble Smith Date:March 16 1999 12:16am
Subject:Re: returning table name
View as plain text  
On Tue, Mar 16, 1999 at 01:14:20AM +0100, sinisa@stripped wrote:
>Marc Antony Vose writes:
>> 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
>
> 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.

Marc Antony, you might want to reorganize your data.  You can
put the "table" from above into the games table.  Then you
would trivially get the information you want by simply selecting
two fields from the same table.

If you want to query only utilities, well it's as simple as adding
"AND table = 'utilities'" at the end of your WHERE clause.

Tim
Thread
File access problemtymiwi14 Mar
  • File access problemMichael Widenius15 Mar
  • Re: File access problemVan15 Mar
    • returning table nameMarc Antony Vose15 Mar
      • returning table namesinisa16 Mar
        • Re: returning table nameThimble Smith16 Mar
Re: File access problemMikael Willberg15 Mar
Re: returning table nameefrazier16 Mar
  • Re: returning table nameThimble Smith16 Mar