List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:June 18 1999 2:25pm
Subject:Re: how to SELECT from table excluding certain columns
View as plain text  
At 2:17 PM -0500 7/13/99, Troy Grady wrote:
>Folks-
>
>Is there any way for a SELECT statement in MySQL to refer to all the
>columns in a table _except_ for a specific column or set of columns?  i.e.
>Something like "SELECT * !(col1, col2, ...) FROM tablename;"

No.  You could get the table structure with DESCRIBE tbl_name or
SHOW FIELDS FROM tbl_name, then construct the list yourself, but
that might be more work than you want to do.  Of course, since
you're using PHP, you could just write a function that takes
a table name and returns a list of columns as the result.

--
Paul DuBois, paul@stripped
Northern League Chronicles: http://www.snake.net/nl/
Thread
how to SELECT from table excluding certain columnsTroy Grady15 Jun
  • Re: how to SELECT from table excluding certain columnsPaul DuBois18 Jun
  • Re: how to SELECT from table excluding certain columnsFred Read19 Jun
RE: how to SELECT from table excluding certain columnsMichael L Smith16 Jun
Re: how to SELECT from table excluding certain columnsTroy Grady16 Jun
  • Re: how to SELECT from table excluding certain columnsVivek Khera16 Jun
Re: how to SELECT from table excluding certain columnsFred Read19 Jun