Re: [SQL] How do I get column names?

Поиск
Список
Период
Сортировка
От neko@kredit.sth.szif.hu
Тема Re: [SQL] How do I get column names?
Дата
Msg-id Pine.LNX.4.10.9912140143180.5706-100000@kredit.sth.szif.hu
обсуждение исходный текст
Ответ на How do I get column names?  ("Steven M. Wheeler" <swheeler@sabre.com>)
Список pgsql-sql
On Mon, 13 Dec 1999, Steven M. Wheeler wrote:

> A simple question.
> 
> What is the best way to query the DB, to get the column names for a
> particular table?
SELECT attname FROM pg_attribute, pg_class WHERE pg_class.oid = attrleid   AND attnum>0 AND relname =
'particular_table';
In this way, in each tuple of the result can find a column name.
Or can use the simple:
SELECT * FROM particular_table LIMIT 1;
This query will be return with a single line, and you can get the column
names from the result. (PQfname).

The first way may a bit faster, but the second can work with user typed
querys too.
 Best Regards
--nek;(




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

Предыдущее
От: Mathijs Brands
Дата:
Сообщение: Re: [SQL] System Attribute
Следующее
От: "Stoyan Genov"
Дата:
Сообщение: SQL'92 web resources