| |

VerySource

 Forgot password?
 Register
Search
View: 708|Reply: 2

How to find records in a table that match a value

[Copy link]

3

Threads

6

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-1-8 05:40:01
| Show all posts |Read mode
For example, if you query all the videos that an actor has performed, if the field of the actor has Keanu Reeves, Keanu Levis, and Keanu Reeves, how should the sql statement to query the record of his movie be written?
select * from movieinfo where actor ...? ?
Reply

Use magic Report

0

Threads

14

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-1-8 22:18:01
| Show all posts
select * from movieinfo where actor like '% 李维斯%'


select * from movieinfo where charindex ('Levis', actor)> 0
Reply

Use magic Report

0

Threads

211

Posts

108.00

Credits

Newbie

Rank: 1

Credits
108.00

 China

Post time: 2020-1-8 22:36:02
| Show all posts
--try

select * from movieinfo where charindex ('Keanu-Levis', actor)> 0

select * from movieinfo where actor like '% Keanu-Levis%'
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list