获取其他产品名称

时间:2015-10-14 07:31:52

标签: mysql sql

我有一个选择让用户新卖:

select 'sells' prefix, p.product_name, k.user, MAX(c.data) as data, c.user, count(c.user)
from sells c
  inner join products p on c.id = p.id 
  inner join cadastro k on c.user = k.id 
where c.user='1' and c.data > now()

我展示了这样的东西:

You sell (p.product_name) and more 4 (count(c.user)) products

好的,我的选择非常好。问题是,我想展示其他4个产品名称

像这样:

You sell (p.product_name 1) and more 4 (count(c.user)) products:
product 2, product 3, product 4 and product 5

如何获得其他产品名称(当然,如果我销售超过1种产品)?

0 个答案:

没有答案