Rate this:

Like this:

In ORACLE
SELECT REPLACE(REPLACE(YourColumn,CHAR(13),NULL),CHAR(10),NULL)FROM YourTable
FOR ONE CHAR :
SELECT replace(YourColumn,CHAR(13),'')
FROM YourTable
OR
update YourTable
set YourColumn =replace(YourColumn,CHAR(13),'')
IN .NETMyString.Replace("\r\n","")
or..
MyString.Replace("\r\n",@"\n")

Potential Blacklist
Special control chars 0-31 by Unicode must be handled

White list
[^a-zA-Zא-ת0-9._] -and punctuation chars by your choice
- this is a start of a regex pattern - [^] -everything that not in the pattern is not allowed.
also can do
[^\w\s\p{IsHebrew}\p{P}] - not taking accesnt chars like ~^ , not finished , but a start
better handled by StringBuilder with loop through chars than Regex
(more than 10 times better).just Whitelist of allowed chars and if in range
like this
if(c>=a && c<=z)...
sb.append(c)
else
sb.append(' '); //replacement char

SELECT last_name, first_name
FROM customer
GROUP BY last_name, first_name
HAVING count(’x’) > 1;

LAST_NAME FIRST_NAME
————————–
PITT DAVID

To delete one of the double record, (please add some filter to specify which record can be deleted)
1. standard
DELETE FROM CUSTOMER A
WHERE ROWID (
SELECT MAX(ROWID)
FROM customer B
WHERE A.last_name = B.last_name
AND A.first_name = B.first_name
AND A.nation = B.nation
);

2. using IN
DELETE FROM CUSTOMER A
WHERE (A.last_name, A.first_name, A.nation) IN (
SELECT B.last_name, B.first_name, B.nation
FROM customer B
WHERE A.last_name = B.last_name
AND A.first_name = B.first_name
AND A.nation = B.nation
AND A.rowid > B.rowid);