I´m running a simple select stament, and it returns a lot of duplicated records, I need to just return to me one row, I had tried using a group by but it gives me an error, I need to know if there exist any other way to fix this issue.
The query is:
select a.co_id,
a.customer_id,
sysadm.func_cap_co_id(co_id, 'RCAT', NULL) RC,
rowid
from mdsrrtab a
where a.co_id in ('123456');
The result is :
1. 123456 163972378 20
2. 123456 163972378 20
As you can see it returs to me duplicated information.
When I use the group by it gives me an ORA-00979, I googled it but still I can´t get a solution.
EDIT
I was able to remove the duplicated rows by removing the rowid, thx to @Mr.Llama who made me look at the rowid.
the query is as follows:
select a.co_id,
a.customer_id,
sysadm.func_cap_co_id(co_id, 'RCAT', NULL) RC
from mdsrrtab a
where a.co_id in ('123456')
group by a.co_id, a.customer_id;
Result
- 1 158634373 163972378 20
Kind regards.