Home > Back-end >  For help in the SQL server where (' 02 ', '3') in the condition how to implement
For help in the SQL server where (' 02 ', '3') in the condition how to implement

Time:10-11

For help in the SQL server where (' 02 ', '3') in the conditions of the brackets can be realized by string concatenation
For example, declare @ SQL
The set @ SQL=?
The where (@ in SQL)
The @ SQL ~ ~ ~ don't know how to splice? Ah, ~ ~ for help you

CodePudding user response:

 declare @ a varchar (200) 
Declare @ b varchar (200)
Declare @ SQL varchar (200)

The set @ a='02'
The set @ b='03'
Set @ SQL='select fields from the table name in the where field ('' 'a + + @' ' ', ' '+ @ b +') '

Print @ SQL
  • Related