G
Guest
Is it possible to order the results of my query by a field that sums the
values of 5 other fields? For example query looks like this:
SELECT projid, tier,
(ASC(financial)+ASC(resource)+ASC(schedule)+ASC(technical)+ASC(alignment)) as
Tot
FROM invfile
WHERE projid IN(projids...,)
AND period=11
AND yr=2005
Result:
projid tier Tot
IY05C92048 1 355
IY05C53028-01 2
IY05C53016-02 2 355
IY05C53016-01 2
IY05C91015 2 355
IY05C53044 3
IY05C91018 3 373
IY05C91017 3 355
IY05C91019 3 355
IY05C91012 3 355
IY05C91010 3 355
IY05C31010 3 355
IY05C31025 3
IY05C53016 Program 355
IY05C53028 Program
I want this to be the order:
projid tier Tot
IY05C91018 3 373
IY05C92048 1 355
IY05C53016-02 2 355
IY05C91015 2 355
IY05C91017 3 355
IY05C91019 3 355
IY05C91012 3 355
IY05C91010 3 355
IY05C31010 3 355
IY05C53016 Program 355
IY05C53028-01 2
IY05C53016-01 2
IY05C53044 3
IY05C31025 3
IY05C53028 Program
Please help,
values of 5 other fields? For example query looks like this:
SELECT projid, tier,
(ASC(financial)+ASC(resource)+ASC(schedule)+ASC(technical)+ASC(alignment)) as
Tot
FROM invfile
WHERE projid IN(projids...,)
AND period=11
AND yr=2005
Result:
projid tier Tot
IY05C92048 1 355
IY05C53028-01 2
IY05C53016-02 2 355
IY05C53016-01 2
IY05C91015 2 355
IY05C53044 3
IY05C91018 3 373
IY05C91017 3 355
IY05C91019 3 355
IY05C91012 3 355
IY05C91010 3 355
IY05C31010 3 355
IY05C31025 3
IY05C53016 Program 355
IY05C53028 Program
I want this to be the order:
projid tier Tot
IY05C91018 3 373
IY05C92048 1 355
IY05C53016-02 2 355
IY05C91015 2 355
IY05C91017 3 355
IY05C91019 3 355
IY05C91012 3 355
IY05C91010 3 355
IY05C31010 3 355
IY05C53016 Program 355
IY05C53028-01 2
IY05C53016-01 2
IY05C53044 3
IY05C31025 3
IY05C53028 Program
Please help,