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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select and group by using functions

Status
Not open for further replies.

jetechie

Technical User
May 23, 2006
15
US
I have a function that returns me a date based on reference data.

TABLE_A
-------
my_date_fld
ref_code

select myfunc(my_Date_fld,ref_Code) as NEW_DATE from TABLE_A;

Depending on what DATE and REF_CODE I pass to it, a date is returned.

I want to get a COUNT(*) of the unique dates returned.

New_DATE COUNT
-------- -----
10-Apr-06 200
11-Apr-06 300

I tried the following, but it fails.

select myfunc(my_Date_fld,ref_Code),count(*)
from TABLE_A
group by
myfunc(my_Date_fld,ref_Code)
;



Thanks for any ideas or approaches!
JE
 
Hi,
Is there a special reason you are using a function to return a value from the table?

What error did your attempt generate?



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top