PostgreSQL
 sql >> Base de données >  >> RDS >> PostgreSQL

Division multiple et attribution de order_id

Utilisez translate() :

SELECT "ID", token, row_number() over (partition by "ID")
FROM (
    SELECT "ID", s.token
    FROM   
        Table1 t, 
        unnest(string_to_array(translate(t.address, '.,:;-', '     '), ' ')) 
            s(token)
    WHERE token <> ''
    ) sub

SqlFiddle .