我的表中有一个名为people的列,这是一个声明。我只需从该列中提取名称。
人:
Ramu is a good dancer.
Raj is the highest scorer in maths.
我需要从这些语句中仅提取名称(ramu,raj)。
提示:is
之前的名称,因为所有语句在这里都有一个单词is
。
我不知道如何在postgresql中提取
答案 0 :(得分:0)
with people(statement) as (
values
('Ramu is a good dancer.'),
('Raj is the highest scorer in maths.')
)
select split_part(statement, ' ', 1) as name
from people;
name
------
Ramu
Raj
(2 rows)