Long data types in Distinct or group by [message #276287] |
Wed, 24 October 2007 12:13  |
vismita
Messages: 4 Registered: October 2007
|
Junior Member |
|
|
Hi,
I need to run a query as
select a,b,c,count(*)
from tbl_name
group by a,b,c having count(*)>1
But c is a long data type.
and this is not allowed....Is it possible to achieve this by PL/SQL scripts?
Thanks
|
|
|
|
|
|
|
|
|
Re: Long data types in Distinct or group by [message #276306 is a reply to message #276305] |
Wed, 24 October 2007 13:30  |
 |
Michel Cadot
Messages: 68737 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Something like:
create or replace to_varchar2 (p_rid rowid)
is
res varchar(32560);
begin
select c into res from mytable where rowid=p_rid;
return res;
end;
/
select a,b,to_varchar2(rowid) c, count(*)
from mytable
group by a,b,to_varchar2(rowid)
/
Regards
Michel
|
|
|