Page 1 of 1

A MySQL question - Select usage

Posted: Thu Aug 28, 2003 9:15 am
by fallen
Hi all,

I just wanted to know if there was a way of requesting all the fields expect a given one when using a select.

I have one huge text field which makes it difficult to view the other data properly whilst debugging.

So is it possible to write

Code: Select all

select * apart from text_field from some_db
Or simliar.

If this is in the MySQL manual 'select' page please feel free to slap me!

Posted: Thu Aug 28, 2003 9:24 am
by JAM
No, I dont think so.

How are you debugging it? I had a similiar problem, but solved it with something similiar to this.

I used print_r() to print out the array in a loop. Before the print_r() was run, i set the blob field to '', example:

Code: Select all

while($row = mysql_fetch_array($result)) {
   $row['text'] = '';
   print_r($row);
 }
Hence the text, was 'emptied'. Perhaps it's a workaround for you also?

Posted: Thu Aug 28, 2003 9:31 am
by fallen
Cheers JAM

Basically I'm checking the contents of the db using command line commands direct to mysql, I can blank the text fields

Code: Select all

update set text_field='';
does it in two shakes of a lambs tail but I'm trying to avoid that. If I wanted to work at it I'd type in a long list of all the other field.

I'm being lazy and so want a really simple answer which may well be "No do it the long way you lazy toad", or hopefully will be use this syntax go.

Posted: Thu Aug 28, 2003 9:32 am
by fallen
Sorry missed the tbl_name out of the code in the previous. It should have been.

Code: Select all

update tbl_name set text_field='';

Posted: Thu Aug 28, 2003 9:37 am
by JAM
Aha, directly in the db. Thats a different story =)

I recommend you to look at the usage of temporary tables, just perhaps, you might be able to find something useful there.

But I'm not 100% sure that there is no way, so those with more experience have to answer.
Good luck tho.

Posted: Thu Aug 28, 2003 9:40 am
by fallen
Same situation here, never seen a way to do it just thought it would be useful here. If anyone is 100% sure I'm just being lazy and asking the impossible please tell me. This query borders on idle curiosity.

Posted: Thu Aug 28, 2003 10:00 am
by Orkan
I've searched on http://www.mysql.com in documentation... They don't mention any posibility of selecting all columns except one...