简体   繁体   English

SQL选择文本搜索

[英]SQL Select text search

I'm trying to make a sql select statement, but I'm confused about something and I'm not sure how to look for it. 我正在尝试制作sql select语句,但是我对某些事情感到困惑,并且不确定如何查找它。

Example: 例:

Given the parameter "AB12", on my SQL I will have a field with value "AB" 给定参数“ AB12”,在我的SQL上,我将有一个值为“ AB”的字段

I'm trying to do is something like: 我想做的是这样的:

Select * From SampleTable Where SampleField+'%' LIKE SampleParameter

I'm tried to explain my best. 我试图尽力而为。

Thanks all 谢谢大家

The LIKE pattern always goes on the right, not the left. LIKE模式始终在右侧而不是左侧。 Presumably, you intend: 大概您打算:

Where SampleParameter LIKE SampleField + '%'

尝试

Where SampleField LIKE SampleParameter + '%'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM