Home > database >  Access to search problem.
Access to search problem.

Time:12-18

I want to ask next, under the condition of only a search box, and how to realize the two search criteria searches,
For example, a student status management form, in a search box can directly input name or student number to search (a can only lose one of them), without a search condition get a search box? Great god give advice or comments, thanks.

CodePudding user response:

 
SELECT * from table
Where the name like '* * * * or student number like' * 0001 * '

So, in the or

CodePudding user response:

 
- lost name, will perform the following
SELECT * from table
Where a name like '* * * * or student number like' * * * *

-- lose one's status as a student, will perform the following
SELECT * from table
Where the name like '* 0001 * or student number like' * 0001 * '

Input a condition, so that you can query
  • Related