SQL查询问题 [英] SQL Lookup question
问题描述
大家好,
我确实有一个SQL数据库,其中的一个简单表包含几行:
零件编号焊件编号长度SmartFeature1 SmartFeature2 SmartFeature3 SmartFeature4 .. SmartFeature15
S-00001 M-00283 150 A-01300-1 1.5 A-01301-3 0.5 A-01401-5 0.4 NULL NULL
S-00002 M-00283 120 A-01300-1 1.49 A-00834-1 1.63 A-00174- 1个 3.47 NULL NULL
.....
等
因此,我正在研究的SolidWorks应用正在为具有特征的模型中的结构构件创建字符串列表:该字符串可能类似于以下内容:
* M-00283 120/A-01300-1 1.49/A-00174-1 3.47/A-00834-1 1.63/
我可以将此字符串拆分成多个部分( M-00283 , A-01300-1 1.49 ,...等),然后开始寻找M-00283零件-那不是问题.
在SQL中,如果找到M-00283以开始一直在该特定行中查找直到A-01300-1 1.49,而不是A-00174-1 3.47,而不是A-00834-1,是否存在一种方法1.63? (SQL中的S-00002-与 *,表示功能和暗淡匹配)
我可以使用任何特殊技术吗?
谢谢
亚历克斯.
Alex
如果此处没有答案,我会将您的问题发布到Transact SQL论坛:>
https://social.msdn.microsoft.com/Forums/sqlserver /en-US/home?forum = transactsql
Hello guys,
I do have SQL database with one simple table that consist a few rows:
PartNumber WeldmentNumber Length SmartFeature1 SmartFeature2 SmartFeature3 SmartFeature4.. SmartFeature15
S-00001 M-00283 150 A-01300-1 1.5 A-01301-3 0.5 A-01401-5 0.4 NULL NULL
S-00002 M-00283 120 A-01300-1 1.49 A-00834-1 1.63 A-00174-1 3.47 NULL NULL
.....
etc
So the SolidWorks app Im working on is creating a list of strings for structural members that in the model with the features: the string may look like one below:
* M-00283 120/A-01300-1 1.49/A-00174-1 3.47/A-00834-1 1.63/
I can split this string up into pieces (M-00283, A-01300-1 1.49, ...etc) and start looking for M-00283 part - that`s not a problem.
Is there a way in SQL if it finds M-00283 to start looking in that particular row all way to the end for A-01300-1 1.49, than for A-00174-1 3.47 than for A-00834-1 1.63 ? (S-00002 in SQL - matches with * , meaning the features and dims matching)
Any special Technics I can use?
Thank you
Alex.
Alex
If you don't get an answer here I would post your question to the Transact SQL forum:
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?forum=transactsql
这篇关于SQL查询问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!