網域名稱俱樂部

網域名稱俱樂部 (https://www.domainclub.org/index.php)
-   電腦網路相關技術 (https://www.domainclub.org/forumdisplay.php?f=16)
-   -   找不同table 相同商品的疑問 (https://www.domainclub.org/showthread.php?t=40312)

Matt 2017-06-30 12:07 PM

找不同table 相同商品的疑問
 
Mysql
table1
-------+-------
goods iphone8
-------+--------
price 29900




table2

-------+-------
goods iphone8
-------+--------
price 19900

引用:

select goods,price from table1 where (goods in(select goods from table2) and price in (select price from table2))
以table1數據為基礎下
我要找出 在table1.goods 等於 table2.goods 商品,條件是 price 也相同 ,我用上面語法執行後結果有值~what

goods 是 text
price 是 text
select where in的用法能像我這樣用嗎? 該怎樣用?


所有時間均為 +8。現在的時間是 05:42 AM

Powered by vBulletin® 版本 3.8.4
版權所有 ©2000 - 2024,Jelsoft Enterprises Ltd.