Jump to content

Archived

This topic is now archived and is closed to further replies.

Dark Lord

How do I select all records where something starts with an A

Recommended Posts

I got as far as:

Select * from `Persons` WHERE `vn` LIKE \'$vn\'

 

but that only selects the ones that are equal to $vn and not the ones starting with $vn... how do i get it to select the ones starting with $vn???

Share this post


Link to post
Share on other sites

Use the wildcard % characters.

 

SELECT * FROM Persons WHERE vn LIKE \'%$vn%\';

Share this post


Link to post
Share on other sites

If he does that Jon, he will get everything with $vn in - starting, middle or ending.

 

He wants:

 

LIKE \'$vn%\'

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.