Extract especific text from a sql statement - Mailing list pgsql-general

From Emanuel Araújo
Subject Extract especific text from a sql statement
Date
Msg-id CAMuTAkab=h0pHDTi-69BU56kjZ5dWcy1kHaUC5C9veAA5xNNDw@mail.gmail.com
Whole thread Raw
Responses Re: Extract especific text from a sql statement
List pgsql-general
Hi,

I need help to extract fields and tables from a sql statement.

Example:

SELECT pc.cod, pc.val, pi.qtd,
COALESCE(pc.name, 'empty') AS name, lower(coalesce(pc.email, 'empty')) as email,
status
FROM pc
INNER JOIN pi on (pc.cod = pi.cod)
WHERE pc.startdate > CURRENT_DATE
order by 1 desc
;

I need to return that:

pc.cod
pc.val
pi.qtd
pc.email
status
pc
pi
pc.startdate



can you help me ?






--
Atenciosamente,

Emanuel Araújo


pgsql-general by date:

Previous
From: "Felix Kunde"
Date:
Subject: Re: table versioning approach (not auditing)
Next
From: Daniel Begin
Date:
Subject: Best practices for Large import in empty database?