This is the code outline I was thinking of using:
CREATE function get_n_chars ( dfrom varchar(9) ) returns varchar(9)
READS SQL DATA
begin
declare d varchar(9);
dfrom REGEXP '^.(...)';
d = $1;
limit 1;
return d;
I was not surprised to get an error, does anyone know the correct syntax, or of this is even possible?
Thanks
Per your comment above:
To retrieve all suspected duplicates, how about something like: