12-04-03, 03:32 #1Registered User
- Join Date
- Dec 2003
Unanswered: Title counts in a field using oracle decode.
I want to write a query to generate a report using decode function in Oracle 8i from the Single field in a table. The requirement is, there are 2 fields Calldate and Menucode in a table, in the Menucode field values will be like '0103020504' sequentially the same has to be replaced with corresponding titles, like for 01 - A; 02 - B; 03 - C; 04 - D; 05 - E;
also should bring individual title counts(with multiple occurences of data across records) from the particular field based on the date.
Table fields: Calldate, MenuCode
field values: Calldate= 04-Dec-03; MenuCode='0103020504' (similar data in multiple rows)
Result structure is: callDate,Titles, OccurencesCount
03 Dec 03 A 25
04 Dec 03 A 10
and so on...
can you please help me on this.
Thanks in advance.
12-04-03, 04:32 #2Registered User
- Join Date
- Apr 2003
- Minneapolis, MN
it is not possible with the single SQL statement.
You have to user PL/SQL block to solve this. I guess you also need to create one temporary table for this.Bhavin
MS Computer Science
OCP DBA 9i/8i