Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
padmaneha
Starting Member
1 Post |
Posted - 2008-09-17 : 07:51:57
|
I have created 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' ,'dishname' 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 dishname blog cid 3 paneer pakora 123569 aloo gobhi 1526515 chinese chickensalad 1896319 Chicken 013 Tomato soup 22156videoid videotitle destid9 paneerpakora.fls 311 aloogobhi.fls 9 16 chinese chickensalad.fls 1545 Chicken.fls 190 tomato soup.FLS 13From 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. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-17 : 08:01:05
|
may be thisselect *from Food fjoin Videos von v.destid=f.foodidwhere f.blog>0 |
|
|
|
|
|