0

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

1 Answer 1

1

You could try

SElECT t1.fid,
       COUNT(t2.fid),
       t1.fage
FROM   Table1 t1 INNER JOIN
       Table2 t2 ON t1.fid = t2.fid
GROUP BY t1.fid, t1.fage
Sign up to request clarification or add additional context in comments.

1 Comment

True, sorry, did it in NotePad++ X-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.