Lists: | pgsql-sql |
---|
From: | "Lawrenzo D'Wolcoto" <bigdog(at)pitnet(dot)net> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | PSQL SELECT Question. |
Date: | 1999-02-11 23:29:10 |
Message-ID: | 199902112329.RAA17351@ultra1.pitnet.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-sql |
Hello everyone!
Heres my question:
I am using JDBC to connect to Postgres, and create a query. The ResultSet
returned by the query contains MetaData about the table. I am using this
table information to build a map of the table.
I need to know how to retrieve an table, with NO rows, or alternativly, just
1 single row (even if more rows exist in the table). ie:
SELECT * TOP 1 FROM TABLE //This does the trick in MS Access
SELECT * FROM TABLE WHERE ROWNUM <= 1 //This works in Oracle?
I need to know how to do this in STANDARD SQL. I would actually prefer
getting NO rows from my query. I remember seeing something like:
SELECT * FROM TABLE WHERE FALSE //This was someones proprietary QL to
provide en empty table (what I would like)
Anyone have any ideas?
Also, I need to know how to do this *WITHOUT* any information about the
coulmns in the table. No names, no keys, nothing. yikes.
PS. Please copy directly to my email, because I am not subscribed to the
majordomo.
Thanks!
Larry Wolcott
bigdog(at)pitnet(dot)net