string sql = "select goods from snap where snap_id=@SNAPID";
string sql = @"select goods_id,goods_name,goods_img,goods.user_id,user_name,goods_level,price,type,goods_num,goods.create_time,update_time from goods LEFT JOIN user_info ON goods.user_id=user_info.user_id where goods_name LIKE '%'+@goods_name+'%'";
第一行是普通查询
第二行是模糊查询
区别是%用单引号包起来,@参数直接+不要双引号拼接