Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Include Summary Column in select statement condition...

Status
Not open for further replies.

bgreen

Programmer
Feb 20, 2003
185
CA
Hi,

I want to include a summary column which is imbedded in the select statement included in the conditional statement (Where statement). How do I do this?
 
The syntax is
Code:
select <fields>, <agregate> from <table>
where <simple condition>
group by <fields>
having <agregate condition>

Regards, Dima
 
The summary column is not part of the select statement. It is a separate entity which has been created at a group level.

CS_COUNT...

would I use &CS_COUNT or :CS_COUNT or can I do it at all.
 
No, I think this is impossible; in this case the value is calculated on client side after your result set has been retreived.
But you may create report trigger to "hide" rows according to some condition based on that aggregate field.

Regards, Dima
 
Though you are getting the summaryi in the report, you can get the same in the SQL also and then do what Dima advised. Another option would be to create a second query in the report (ref cursor query), and link it to the first query using summaty collumn as parameter.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top