Reputation: 12367
I have a table with the following structure in Oracle database:
CREATE TABLE PASSENGERS
(ID VARCHAR2(6),
PASSPORTNO VARCHAR2(14));
I want to get the IDs of the passengers who have been registered more than once. For that I run the following query.
SELECT ID FROM PASSENGERS WHERE PASSPORTNO IN
(SELECT PASSPORTNO FROM PASSENGERS
GROUP BY PASSPORTNO
HAVING COUNT(*)>1);
But I get "unsuported character set" error. What's the point I'm missing?
Upvotes: 2
Views: 3523
Reputation: 51
Mostly seems like a data issue. Try checking the exact data row which is causing the issue.
Use : DML Error Logging - http://www.oracle-base.com/articles/10g/dml-error-logging-10gr2.php
Btw, you are doing GROUP BY passportno
.Is that correct? (This implies multiple passports can have same passport number). I guess it should be GROUP BY id
Upvotes: 2
Reputation: 1092
Since all queries related with PASSPORTNO are running fine you have at least two more things to do:
SELECT ID FROM PASSENGERS
and check for errors, if the error cames up, then it may be releated with content stored in your tableSince both ID and PASSPORTNO are varchar fields, there's a big change to one of then have data in a enconding which oracle can't decode properly.
Upvotes: 2