How to do SELECT *-`Column1` from TABLE?
How to do SELECT *-`Column1` from TABLE?
am 20.07.2006 20:52:20 von talthen.z-serwera.o2
Hello,
I have records that have many columns. Most of them are of type INT or
VARCHAR, but a few columns are pretty big (TEXT) (like COLUMN1). When I do:
SELECT * FROM TABLE
it takes a lot of time, but I don't need data from COLUMN1 and don't want to
write code like this:
SELECT column2,column3,....column20 from TABLE
I would rather do something like:
SELECT (ALLCOLUMNS BUT COLUMN1) FROM TABLE
How to write such thing for MySQL?
Regards,
Talthen
Re: How to do SELECT *-`Column1` from TABLE?
am 20.07.2006 21:50:17 von IchBin
talthen.z-serwera.o2@nospam.pl wrote:
> Hello,
> I have records that have many columns. Most of them are of type INT or
> VARCHAR, but a few columns are pretty big (TEXT) (like COLUMN1). When I do:
> SELECT * FROM TABLE
> it takes a lot of time, but I don't need data from COLUMN1 and don't want to
> write code like this:
> SELECT column2,column3,....column20 from TABLE
> I would rather do something like:
> SELECT (ALLCOLUMNS BUT COLUMN1) FROM TABLE
>
> How to write such thing for MySQL?
>
> Regards,
> Talthen
>
>
The only way I can think of doing the way you want is to create a VIEW.
In the view you have all of the columns you want.
Then just select * from the view.
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
____________________________________________________________ ______________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Re: How to do SELECT *-`Column1` from TABLE?
am 21.07.2006 14:46:41 von zac.carey
IchBin wrote:
> talthen.z-serwera.o2@nospam.pl wrote:
> > Hello,
> > I have records that have many columns. Most of them are of type INT or
> > VARCHAR, but a few columns are pretty big (TEXT) (like COLUMN1). When I do:
> > SELECT * FROM TABLE
> > it takes a lot of time, but I don't need data from COLUMN1 and don't want to
> > write code like this:
> > SELECT column2,column3,....column20 from TABLE
> > I would rather do something like:
> > SELECT (ALLCOLUMNS BUT COLUMN1) FROM TABLE
> >
> > How to write such thing for MySQL?
> >
> > Regards,
> > Talthen
> >
> >
>
> The only way I can think of doing the way you want is to create a VIEW.
> In the view you have all of the columns you want.
>
> Then just select * from the view.
>
> Thanks in Advance...
> IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
> ____________________________________________________________ ______________
>
> 'If there is one, Knowledge is the "Fountain of Youth"'
> -William E. Taylor, Regular Guy (1952-)
I'm not sure if there will be any performance gain but you could use a
describe statement to pass the field names as an array to php and then
use php to first modify that array and then generate the select
statement
Re: How to do SELECT *-`Column1` from TABLE?
am 22.07.2006 11:04:49 von talthen.z-serwera.o2
Thank you both for the ideas.
Regards,
Talthen