[thelist] [SQL] SELECT Question

Luther, Ron ron.luther at hp.com
Fri May 27 11:24:18 CDT 2005


Jacques Capesius asked:


>>	<snip> as 'Sales',
>>	<snip> as 'quota',
>>	??? as 'Percent to Quota'


Hi Jacques,


In Oracle I believe you can simply use:

'Request.Sales / Request.quota' as 'Percent to Quota'
 ^^^^^^^         ^^^^^^^

Maybe other dbs have a similar syntax for this kind of thing.


I think that should do the trick for you! 

(That lets the db know that the field is defined in the request 
[select] statement and is not a table field.)


HTH,

RonL.

(That's what I use when I define a complicated critter in a select 
statement and then need to reference that same critter inside 
another ugly function within the same select statement.)


More information about the thelist mailing list