|
Go
![]() |
New
![]() |
Search
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Silver Member |
Hi,
I need to give a where clause using 'like' with 2 string values. e.g. w where column_name like 'abc' and 'xyz' What would be the right syntax? |
||
|
|
Master |
It totally depends on where you want the comparison WHERE column_name LIKE 'abc%_' OR 'xyz%_' I'm sure for such a well documented basic WebFocus process learning to read would help you a great deal in your tasks. |
|||
|
|
Guru |
I agree with JG
As Tony A has mentioned many times the link at the top right of the page will get you to the documentation. Although I would code WHERE column_name LIKE '%abc%' AND column_name LIKE '%xyz%' Depending on what you mean by like and the values. Does it contain abc and xyz? Waz...
|
|||||||||||
|
|
Virtuoso |
Tony is correct. It needs to be an OR not an AND. Otherwise you won't get any data.
Ginny --------------------------------- Prod: WF 7.6.5 with 7.6.6 WFRS; AIX 5.2; WebSphere 6.1.0.15 Dev: WF 7.6.5 with 7.6.6 WFRS; AIX 5.3; WebSphere 6.1.0.15 Primarily self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable |
|||
|
|
Master |
Ginny,
Tony is correct, IF you want the column to contain BOTH 'abc' AND 'xyz' However if you require either/or then 'OR' is required, The % at the the begining or/end depends on the postion of the search string.
Should perhaps have been Where and What you want the comparison to be. |
|||
|
|
Guru |
The issue with getting no data comes down to how you code the WHERE clause
TABLE FILE CAR PRINT COUNTRY WHERE COUNTRY LIKE '%E%' AND '%G%' END Produces an error TABLE FILE CAR PRINT COUNTRY WHERE COUNTRY LIKE '%E%' OR '%G%' END Produces a list of ENGLAND, W GERMANY, FRANCE. But if you use TABLE FILE CAR PRINT COUNTRY WHERE COUNTRY LIKE '%E%' AND COUNTRY LIKE '%G%' END You get ENGLAND, W GERMANY Waz...
|
|||||||||||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|

