1
我有如下表:MySQL查詢返回匹配的元素的列表清單
Products ::= id int, category varchar, line varchar, type varchar, marketType enum('first','second')
我想要做的就是找到id
S的所有產品名單與同category
,line
,type
; line
也可能是NULL
或空字符串。
例子:
+------+----------+--------+------+ | id | category | line | type | +------+----------+--------+------+ | 123 | 1 | qwerty | X | | 534 | 1 | qwerty | X | | 90 | 1 | qwerty | Z | | 666 | 2 | qwerty | Z | | 444 | 2 | qwerty | Z | | 1616 | 2 | qwerty | Z | | 921 | 2 | | X | | 16 | 2 | | X | +------+----------+--------+------+
我要完成的結果是,其中每個元素是匹配id
s的名單列表:
123, 534 90 666, 444, 1616 921, 16
謝謝你的金牌幫助! – linuxatico