select t1.country_sn as "countrySn",t1.country_name as "countryName" from country t1 where country_id = 1 (select t2.product_info_sn as "productInfoSn",t2.product_info_name as "productInfoName" from product_country_cate t2 where country_id = 2)如何和并在一起
时间: 2023-03-25 07:02:18 浏览: 95
FD_SET Select函数使用
4星 · 用户满意度95%
可以使用 INNER JOIN 或者 LEFT JOIN 连接两个表,将它们合并在一起。具体的 SQL 语句如下:
SELECT t1.country_sn AS "countrySn", t1.country_name AS "countryName", t2.product_info_sn AS "productInfoSn", t2.product_info_name AS "productInfoName"
FROM country t1
INNER JOIN product_country_cate t2 ON t1.country_id = 1 AND t2.country_id = 2
这样就可以将两个表的数据合并在一起了。
阅读全文