查找_IN_set()vs IN()
OrderID | attachedCompanyIDs------------------------------------ 1 1,2,3 2 2,4
CompanyID | name-------------------------------------- 1 Company 1 2 Another Company 3 StackOverflow 4 Nothing
SELECT name FROM orders,companyWHERE orderID = 1 AND FIND_IN_SET(companyID, attachedCompanyIDs)
SELECT name FROM orders,companyWHERE orderID = 1 AND companyID IN (attachedCompanyIDs)
name---------------Company 1Another Company StackOverflow
name---------------Company 1
墨色风雨
忽然笑
相关分类