Click here to Skip to main content
15,884,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a table id did name
1|2|san
2|2|bang1
3|3|spam
4|2|23andmd

now i want to make a quarry to find id 4 with name 00123and me
or i want to get id 2 searching name with 001bang1

What I have tried:

SELECT * FROM `subdomain` WHERE `did` = 18 AND `name` LIKE '%00123andme%'
Posted
Updated 1-Sep-22 9:22am
Comments
Richard MacCutchan 1-Sep-22 14:10pm    
But the name field is 23andmd not 00123andme.

1 solution

SELECT * FROM subdomain WHERE LOCATE(`name`, '00123andme') >= 1;
 
Share this answer
 
v2
Comments
sumoncse07 1-Sep-22 15:25pm    
this is closer but not 100%

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900