开发者

mysql :How to select two different column values from a single table using two different values of another table

My goal is to select two different开发者_运维知识库 values,say c & d from table2 using the fields a and b of table1 in a single query.

Any help would be deeply appreciated.

Thanks.


SELECT table2.c, table2.d
FROM table2
JOIN table1 ON table2.some_common_field = table1.other_common_field
WHERE (table1.a = XXX) AND (table1.b = YYY)
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜