Co pokazuje:
SELECT
s.id, (CASE WHEN s.name2 IS NOT NULL THEN
s.name || ' ' || s.name2 ELSE
s.name END) AS name,
t.name AS typename
FROM location_streets s
LEFT JOIN location_street_types t ON (s.typeid =
t.id)
WHERE s.name2 IS NOT NULL
ORDER BY
s.name
LIMIT 10;