Thread

  1. find the number of row for each tables

    Patrick Coulombe <11h11@videotron.ca> — 2000-06-14T03:01:18Z

    hi,
    here's the question : if I do this query on my database :
    
    SELECT * from friends, strangers WHERE friends.f_id = strangers.s_id AND
    friends.categorie = 1
    ----------
    88 rows
    
    and I need to do this query to know how many rows just for my table friends
    (not both table) :
    
    SELECT * from friends WHERE friends.f_id = strangers.s_id AND
    friends.categorie = 1
    ----------
    80 rows
    
    
    Can I just do 1 query and be able to find the number of row for each tables?
    Hope to be understand...
    
    Patrick
    
    
    
    
  2. Re: find the number of row for each tables

    Karl F. Larsen <k5di@zianet.com> — 2000-06-14T12:23:30Z

    Try simply SELECT * from friends;
    
    
    On Tue, 13 Jun 2000, Patrick Coulombe wrote:
    
    > hi,
    > here's the question : if I do this query on my database :
    > 
    > SELECT * from friends, strangers WHERE friends.f_id = strangers.s_id AND
    > friends.categorie = 1
    > ----------
    > 88 rows
    > 
    > and I need to do this query to know how many rows just for my table friends
    > (not both table) :
    > 
    > SELECT * from friends WHERE friends.f_id = strangers.s_id AND
    > friends.categorie = 1
    > ----------
    > 80 rows
    > 
    > 
    > Can I just do 1 query and be able to find the number of row for each tables?
    > Hope to be understand...
    > 
    > Patrick
    > 
    > 
    > 
    > 
    
    Yours Truly,
    
      	 - Karl F. Larsen, k5di@arrl.net  (505) 524-3303  -
    
    
    
  3. Re: find the number of row for each tables

    Patrick Coulombe <11h11@videotron.ca> — 2000-06-14T15:36:04Z

    > Try simply SELECT * from friends;
    ???
    Not working... I just want to know if it's possible to know how many rows
    the query return for each table when i do a query with two table ie: select
    * from table1, table2 where...
    
    can i know the number of row for table1 and the number of row for table2
    without do 2 querys.
    
    thank you
    hope to be more clear this time
    patrick
    
    
    
    
    > On Tue, 13 Jun 2000, Patrick Coulombe wrote:
    >
    > > hi,
    > > here's the question : if I do this query on my database :
    > >
    > > SELECT * from friends, strangers WHERE friends.f_id = strangers.s_id AND
    > > friends.categorie = 1
    > > ----------
    > > 88 rows
    > >
    > > and I need to do this query to know how many rows just for my table
    friends
    > > (not both table) :
    > >
    > > SELECT * from friends WHERE friends.f_id = strangers.s_id AND
    > > friends.categorie = 1
    > > ----------
    > > 80 rows
    > >
    > >
    > > Can I just do 1 query and be able to find the number of row for each
    tables?
    > > Hope to be understand...
    > >
    > > Patrick
    
    
    
  4. Re: find the number of row for each tables

    Jesus Aneiros <aneiros@jagua.cfg.sld.cu> — 2000-06-15T02:34:01Z

    On Tue, 13 Jun 2000, Patrick Coulombe wrote:
    
    > SELECT * from friends WHERE friends.f_id = strangers.s_id AND
    > friends.categorie = 1
    > ----------
    > 80 rows
    
    SELECT *
    FROM friends F
    WHERE friends.categorie = 1 AND EXISTS (SELECT *
    					FROM strangers
    					WHERE F.f_id = strangers.s_id);
    
    > Can I just do 1 query and be able to find the number of row for each tables?
    
    We have to use UNION.
    
    Jesus.