关于通过比较列中的数据来选择数据的问题 [英] Question about select data by compare data in column

查看:70
本文介绍了关于通过比较列中的数据来选择数据的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我已经在表中添加了产品数据

在我的表格中有很多列Example id,name,description

我的问题在这里

如果第一个产品缺货并且描述有咳嗽,发烧,感冒

我想选择其他描述中有一些数据的产品,例如第一个产品

示例产品3有发烧,打喷嚏等的描述.

如何创建sql语句以选择具有某些文本的product3,例如在description列中的第一个产品

非常感谢您的回答,对我的英语很抱歉,我的英语不好,但是我尝试练习

Now i have Product data that have been add in table

in my table have many column Example id,name,description

my question was here

if first product was out of stock and that have description cough,fever,cold

i want to select another product that have some data in description like first product

example product3 have description fever,Sneeze,etc..

how to create sql statement to select product3 that have some text like my first product in description column

thank you so much for answer and so sorry for my english, i''m not good in english but i''ve try to practice

推荐答案

分隔符,在这种情况下,我认为它是逗号,然后进行动态查询并使用类似的运算符添加分隔的描述....这有点慢,但是您会得到所需的结果.
CTE也可以解决您的问题....

要获得更多帮助,请共享表结构.

问候
split the description with delimeter, in this case i think its comma, then make a dynamic query and add the divided description with like operator....this is a bit slow but u''ll get the required result.
CTE can also solve ur problem....

for further assistance please share the table structure.

Regards


这篇关于关于通过比较列中的数据来选择数据的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆