select good_id from order_table,good_table
where order_table.order_goodlist like '%'+str(good_id)+'%'
加上
group by good_id 试试
where order_table.order_goodlist like '%'+str(good_id)+'%'
加上
group by good_id 试试
where good_id in (select order_goodlist from order_table)
where charindex(@goodid,order_table.order_goodlist)>0
select count(order_id) from order_table,good_table
where order_table.order_goodlist like '%'+str(good_id)+'%'
主题上的不对。希望各位帮忙,谢谢!
'%'+str(good_id)+'%'
改成
'%'+CONVERT(varchar(6),good_id)+'%'
就可以了。
不过还是要谢谢大家如此热心,散分!
这里肯定有问题