Home > database >  The Oracle database using multiple like fuzzy query
The Oracle database using multiple like fuzzy query

Time:10-30

Fuzzy query, I would like to have two fields on the query, I can only like in front of the query, like in front of the empty is not query all

CodePudding user response:

Put the or cache union
SELECT * FROM WHERE A LIKE '% %' OR A LIKE '% ABC %'
Switch to
SELECT * FROM WHERE A LIKE '% %'
The UNION
SELECT * FROM WHERE A LIKE '% ABC %'

CodePudding user response:

Change the or to the union
SELECT * FROM WHERE A LIKE '% %' OR A LIKE '% ABC %'
Switch to
SELECT * FROM WHERE A LIKE '% %'
The UNION
SELECT * FROM WHERE A LIKE '% ABC %'

CodePudding user response:

Are there any other way, I tried to use

CodePudding user response:

A LIKE '% %' OR A LIKE '% ABC %'
Switch to
A LIKE '%' | | TRIM (' ') | | '%' OR A LIKE '% ABC %'
Change space into the air

CodePudding user response:

It is found out, but still query the all

CodePudding user response:

Take out your statements and have a look

CodePudding user response:

Bring out your statements to see, don't pictures, to code,

CodePudding user response:

SELECT * FROM
(
The SELECT EPM_CODE EPM_NAME, T_ID_EDI_AFSYS_MAP. *
The FROM T_ID_EDI_PARTNER_MASTER, T_ID_EDI_AFSYS_MAP
WHERE EPM_KEY=EAM_PARTNER
AND EPM_CODE IN (
'SHA - TALLY'
)
AND EAM_TYPE IN
(
'CONTAINER'
)
AND EPM_FILTER_3 IN
(
'CNYCC $SHA', 'CNHMS $SHA'
)
UNION ALL
The SELECT EPM_CODE EPM_NAME, T_ID_EDI_AFSYS_MAP. *
The FROM T_ID_EDI_PARTNER_MASTER, T_ID_EDI_AFSYS_MAP
WHERE EPM_KEY=EAM_PARTNER
AND EPM_CODE IN (' SSE,
'the SSE - SIN'
'the SSE - TW,
'the SSE - UK'
)
AND EAM_TYPE IN
(
'LOCATION'
'CHARGEID'
)
AND EPM_FILTER_3 IN
(
'CNYCC $SHA', 'CNHMS $SHA'
)
) A
Where EPM_Name like '% %' OR EAM_TYPE like '% %'

  • Related