请帮我处理命令的连接结果(MS SQL):
SELECT name,value FROM table1 WHERE idfoo1 IN(SELECT _id FROM table3 where id = 1);
SELECT value FROM table2 WHERE idfoo2 IN(SELECT _id_2 FROM table3 where id = 1) AND name='fooname';
我得到:
name value
John 2
Bill 32
Alex 11
value
434
234
144
但我需要加入结果。
name value value
John 2 434
Bill 32 234
Alex 11 144
所以,id == id, _id != _id_2,