I'm not even sure that it is possible to do this, but I do not have a query based on the maximum value of either of these I want to order three pillars. Example table structure: Grid, Column 1, Column 2, Column 3
Columns 1-3 have numeric values and I want to order selection statement based on the maximum value of 1, 2 or 3.
For example:
record column 1 column2 column3 --------------------- - ----------- 1 5 0 2 2 2 0 6 3 0 1 2
Record 2, 1, 3 will be ordered because the maximum value is 6 In three areas of records, record 1 second and record 3 is third.
Can it make any sense?
Thank you.
This may be possibly in a select query (possibly As is the case when
though I'm not sure that it is allowed in depends on DBMS that
, YMMV by the Clause itself), but rarely to use per-line calculations There is a good idea if you want to properly scale your database as the table becomes big ("one Stilted pig "in Ode race, as an incident puts it in our DBA).
In such circumstances, I keep a maximum (indexed) column maximized and to ensure that the data integrity is forced to insert that new column to the maximum of the other three, Update is maintained using the trigger.
Because most database tables are read more often than written, it refines the calculation cost in all. Cost only occurs when the data is updated and when you are ordering on a single, indexed, column, the questions become faster than the questions:
f1, f2, f3 Select fmax desc;
Comments
Post a Comment