簡體   English   中英

mysql:如何使用另一個表的兩個不同值從一個表中選擇兩個不同的列值

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

我的目標是在單個查詢中使用table1的字段a和b從table2中選擇兩個不同的值,例如c&d。

任何幫助將不勝感激。

謝謝。

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)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM