At 10:38 -0500 11/8/03, karthikeyan wrote:
I have a table with about 100 column with different column name. It is
difficult to remember all the field
names. But I know the last few columns are very important for query and
used frequently.

You cannot perform comparisons on columns by using column positions.


If they're that important, why is it any more difficult to remember
their names than to remember their positions?

If you really want to use positions, you'll have to do something like
issuing a SHOW COLUMNS statement, read the result to see which columns
are at which positions. That will give you the appropriate column
names.  Seems like a lot of work just to avoid knowing the column
names. :-)


For example:

Table with fields weight_42(double),width_43(double),height_44(double)
where the fields(42), field(43) and field(44) respectively

mysql> select * from data_base where weight_42 < 45.23 or  width_43 <
43.23 or height_44 < 43.23 ;

can i query using :

mysql> select * from data_base where field(43) < 45.23 and field(44) <
45.23 and field(45) < 45.23;

or to use in java:
float j=43.25;
for(i=43;i<=45;i++)
{
S1=select * from data_base where field("   + i +") < "   + j;
QUERY,
RESULT SET
etc.,
}



--
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

Are you MySQL certified? http://www.mysql.com/certification/


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to