pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: is it possible to get the number of rows of a table?
3+ messages / 3 participants
[nested] [flat]

* Re: is it possible to get the number of rows of a table?
@ 1970-01-01 00:00  Haller Christoph <ch@rodos.fzk.de>
  parent: Frederick Klauschen <fklauschen@yahoo.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Haller Christoph @ 1970-01-01 00:00 UTC (permalink / raw)
  To: fklauschen@yahoo.com; +Cc: pgsql-sql

> 
> I would like to compare the number of rows
> of one table and of another and use it in
> a  query like this:
> SELECT * FROM xxxx
> WHERE   "number of rows of table xxxx"
>                   EQUALS
>                    "number of rows of table yyyy"
> i.e. I only want get a query result if the tables
> have the same number of rows.
> Is there a function or a way to do this ?
> 
> Thanks,
> Frederick
> 
Basically, the way to find out about the number of rows 
of a table is "select count(*) from t1"
But the select statement above looks odd to me 
(no offence intended). 
To receive a selection of certain rows of a table 
you have to reference at least one column of that 
table in the where clause like in 
"select * from table1 t1 where t1.c1 = (select count(*) from t2)" 
I hope this helps at least a bit. 
Regards, Christoph 




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* is it possible to get the number of rows of a table?
@ 2001-09-26 15:14  Frederick Klauschen <fklauschen@yahoo.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Frederick Klauschen @ 2001-09-26 15:14 UTC (permalink / raw)
  To: pgsql-sql

I would like to compare the number of rows
of one table and of another and use it in
a  query like this:
SELECT * FROM xxxx
WHERE   "number of rows of table xxxx"
                  EQUALS
                   "number of rows of table yyyy"
i.e. I only want get a query result if the tables
have the same number of rows.
Is there a function or a way to do this ?

Thanks,
Frederick


__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. http://im.yahoo.com



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: is it possible to get the number of rows of a table?
@ 2001-09-26 16:56  Wei Weng <wweng@kencast.com>
  parent: Frederick Klauschen <fklauschen@yahoo.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Wei Weng @ 2001-09-26 16:56 UTC (permalink / raw)
  To: pgsql-sql

This should be really easy to implement in a function yourself. And I don't
think there is already something similar in pgsql.

==========
Wei Weng
Network Software Engineer
KenCast Inc.



> -----Original Message-----
> From: pgsql-sql-owner@postgresql.org
> [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Frederick Klauschen
> Sent: Wednesday, September 26, 2001 11:15 AM
> To: pgsql-sql@postgresql.org
> Subject: [SQL] is it possible to get the number of rows of a table?
>
>
> I would like to compare the number of rows
> of one table and of another and use it in
> a  query like this:
> SELECT * FROM xxxx
> WHERE   "number of rows of table xxxx"
>                   EQUALS
>                    "number of rows of table yyyy"
> i.e. I only want get a query result if the tables
> have the same number of rows.
> Is there a function or a way to do this ?
>
> Thanks,
> Frederick
>
>
> __________________________________________________
> Do You Yahoo!?
> Get email alerts & NEW webcam video instant messaging with Yahoo!
> Messenger. http://im.yahoo.com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2001-09-26 16:56 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-09-26 15:14 is it possible to get the number of rows of a table? Frederick Klauschen <fklauschen@yahoo.com>
1970-01-01 00:00 ` Haller Christoph <ch@rodos.fzk.de>
2001-09-26 16:56 ` Wei Weng <wweng@kencast.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox