Thanks dread. Yes it can be done programmatically. But i try to do only with sql. I don't want to hardcode it.

[EMAIL PROTECTED] wrote:

On 24-Feb-2003 Veysel Harun Sahin wrote:


Hello list,

I want to select all the columns in a table except one column. Can I do this without writing all the column names to the query? For example assume that I have table with the name table1 and there are 50 columns in table1 with the names col1, col2, col3.....col50. To be able to select all the columns except col35 I have to write a query like "SELECT col1, col2, ...., col34, col36, ....col50 FROM table1". Is there a simpler way to do this for example using not operator with the column name col35?




Not that I know of. Depending on the application & language it might be easier to post-process:


   $result = mysql_query('SELECT * FROM mytable');
   while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
       unset($row[34]);
       echo 'The values :', implode(', ', $row), '<br>';
   }


Regards,



--


Veysel Harun Sahin
[EMAIL PROTECTED]




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