put text list into table form

Поиск
Список
Период
Сортировка
От Web2cad
Тема put text list into table form
Дата
Msg-id 001801c6221f$8bd39e30$7dfda8c0@hpxw4100
обсуждение исходный текст
Ответы Re: put text list into table form  (Sean Davis <sdavis2@mail.nih.gov>)
Список pgsql-novice
Hi
I have a list of cities stored in flat file that I would like to left join with another table.
 
The file looks like this:
city1,city2,city3
 
I want to put them into a table like this:
 city
--------
city1
city2
city3
 
I don't actually want to store them into the data base. I just want to get the above table with a select statement.
 
At the moment I'm using this statement which I feel is rather ugly:
select 'city1' union select 'city2' union select 'city3'
 
Is there a way of putting a text list into table form without using a bunch of unions? Like a row separator  (RS)?
So I can do something like
select 'city1'(RS)'city2'(RS)'city3'
 
Thanks for any help

В списке pgsql-novice по дате отправления:

Предыдущее
От: "Gerard Cullen"
Дата:
Сообщение: Using postgresql on Debian
Следующее
От: Rob
Дата:
Сообщение: Charting postgres schemas and table data into Kivio