You are here: Re: How to do SELECT *-`Column1` from TABLE? « PHP SQL « IT news, forums, messages
Re: How to do SELECT *-`Column1` from TABLE?

Posted by strawberry on 10/14/01 11:53

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация