Re: to count no of columns in a table

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: to count no of columns in a table
Date: 2006-02-16 09:37:17
Message-ID: 20060216093717.GC15433@webserv.wug-glas.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

am 16.02.2006, um 14:43:43 +0530 mailte AKHILESH GUPTA folgendes:
> hi all,
> i just want to know one thing that is there any function in PGSQL which
> gives me the total number of columns in a table.

select count(column_name) from information_schema.columns where table_name='foo';

HTH, Andreas
--
Andreas Kretschmer (Kontakt: siehe Header)
Heynitz: 035242/47215, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
=== Schollglas Unternehmensgruppe ===

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ragnar 2006-02-16 09:40:36 Re: [SQL] to count no of columns in a table
Previous Message Juris 2006-02-16 09:34:50 Re: to count no of columns in a table

Browse pgsql-sql by date

  From Date Subject
Next Message Ragnar 2006-02-16 09:40:36 Re: [SQL] to count no of columns in a table
Previous Message Juris 2006-02-16 09:34:50 Re: to count no of columns in a table