Home > database >  A parameter is a comma separated how multiple values for the parameters of the fuzzy query
A parameter is a comma separated how multiple values for the parameters of the fuzzy query

Time:09-28

A parameter is a comma separated how multiple values for the parameters of the fuzzy query
@ page_title, for example the value of this parameter may be,2,3,4,5,6,7 (1), how about this a few number of fuzzy query,
Can help you to write a stored procedure, for example?

CodePudding user response:

Problem has been solved, the steps are as follows:
(1) fuzzy query conditions are needed to put in a variable (comma-separated multiple values need to use circular manner and remove the last output data)
(2). The first half of SQL (selet... from ... Where) are placed in a variable,
(3). If the back has a group by (or other conditions and... ) should also be placed in a variable,
(4). Finally the exec (three variables together),

On more than one field value fuzzy query, now I just want to produce this kind of method above (note: I need only allowed to use stored procedures, such as usable Java or other languages can be in the business layer stitching good SQL)

CodePudding user response:

Write a string cutting function bai, of CSDN

CodePudding user response:

https://blog.csdn.net/yenange/article/details/79788877

 
Select * from tableName where columnName in (
Select the value from string_split (@ page_title, ', ')
)
  • Related