user3165438
user3165438

Reputation: 2661

SQL % Character

I have a t_package table with PackageFlags entry.
I would like to retrieve packages which contains the sub string "VCCFG=Use_Case_View;" in the PackageFlags.

When I execute the following statement I get the expected result :

SELECT * FROM t_package  
WHERE t_package.PackageFlags LIKE 'Recurse=0;'+'VCCFG=Use_Case_View;'  

But when I execute the same statement with %instead of the whole string in PackageFlags, I have no results at all.

SELECT * FROM t_package   
WHERE t_package.PackageFlags LIKE '%VCCFG=Use_Case_View;'  

Any ideas?

Upvotes: 0

Views: 75

Answers (2)

Sky
Sky

Reputation: 3360

SELECT * FROM t_package   
WHERE t_package.PackageFlags LIKE '*VCCFG=Use_Case_View;'  

After finding out the DBMS you're on; the syntax for Access wildcard is * instead of %.

Upvotes: 2

JohnLiz15
JohnLiz15

Reputation: 55

Have you tried to use '% %'?

SELECT * FROM t_package   
WHERE t_package.PackageFlags LIKE '%SEARCH%' 

Upvotes: 0

Related Questions