SQL Select Query to fetch Count of two columns from two different tables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • padmaneha
    New Member
    • Sep 2008
    • 17

    SQL Select Query to fetch Count of two columns from two different tables

    Hi

    Thanks for your response but the query which you gave in my previous post doesnt work. It displays the same cnt for movie reviews and videoreviews

    Let me explain you in detail

    As I said I have got two tables like one is 'Food table' and the other one is the 'Videos' table

    Columns which I have created in 'Food' table are 'foodid' and 'blogcid'
    colcumns which I have created in Videos table are 'videoid, 'destid', 'videotitle'

    Common column for the above two tables are foodid and destid which has the same content id for inner join

    I need to fetch records of those foodids which has got blogs and videos

    For example

    Food id blog cid
    3 12356
    9 15265
    15 18963
    19 0
    13 22156

    videoid videotitle destid
    9 paneerpakora 3
    11 aloogobhi 9
    16 chinese chickensalad 15
    45 Chicken 19
    0 tomato soup 13

    From the above data I have to fetch only those records which has blogs and videos. In other words I need a select query to fetch records of those dishes alone which has blogs >0 and destid >0 which means that fetched foodids should have both blogs and videos it should fetch records which doesnt have blogs or videos.
Working...