MySQL Forums
Forum List  »  Newbie

Re: How to invert select statements?
Posted by: Felix Geerinckx
Date: May 10, 2005 03:18PM

chris.cowart wrote:

> Lets say I have a table with fields 'Year', 'Make', and 'Model'.
> SELECT NOT(Year) FROM MyTable;
> If this worked, I would get a table with the columns 'Make' and 'Model'.
> Is there any way to do such a thing in MySQL

No.

> or would I have to explicitly list each column I want to select?

Explicitly listing each column you need is considered a good thing.

> I am interfacing MySQL from PHP, and I think it would be somewhat innefficient to explicitly list
> which columns I wanted as I would have to use PHP to query MySQL with 'DESCRIBE MyTable;',
> and then fetch each column name

Unless you are writing a generic MySQL frontend application (of which there are plenty already), you *know* the columns of your tables, so you just type them in.

--
felix
Please use BBCode to format your messages in this forum.

Options: ReplyQuote


Subject
Written By
Posted
Re: How to invert select statements?
May 10, 2005 03:18PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.