sql count() query for tables

Posted by air on Stack Overflow See other posts from Stack Overflow or by air
Published on 2010-03-27T12:59:13Z Indexed on 2010/03/27 13:03 UTC
Read the original article Hit count: 125

Filed under:
|

i have two tables

table1 fields

      fid,fname,fage
      a  ,abc  ,20
      b  ,bcv  ,21
      c  ,cyx  ,19

table2 fields

     rcno,fid,status
     1   ,a  ,ok
     2   ,c  ,ok
     3   ,a  ,ok
     4   ,b  ,ok
     5   ,a  ,ok

i want to display rectors like this

     fid from table1 , count(recno) from table 2 and fage from table1         

     fid,count(recno),fage
     a  ,3           ,20
     b  ,2           ,21
     c  ,1           ,19

i try many sql queries but got error

Thanks

© Stack Overflow or respective owner

Related posts about mysql

Related posts about sql