开发者

Taking values from two tables

There are two tables: pg_vendor_signup and pg_vendor_friends:

pg_vendor_signup:
id vendor_id  name country_id
 1         3  ramu        381
 2         4   raj        381
 2         4  usha        381
 3         4 krian        381
 4         4  manu        381
 4         9 aswin        381

pg_vendor_friends:
vid fid status
1     9      4    
1     9      3
开发者_StackOverflow

I want to get all names where country_id = 381 and get status field from pg_vendor_friends.


Its not very clear what you want.

In case you want the name and status of all with country_id = 381 you can do:

select name,status 
from pg_vendor_signup,pg_vendor_friends
where id = vid and country_id = 381;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜