Converting SQL server query to mysql
Posted by:
Ozark Ram
Date: May 25, 2022 09:18AM
Hi All,
I am trying to convert the following SQL server query to mysql ..Can you please help me here..
SELECT *,CASE WHEN PATINDEX('%S%LD%',orderstatus)>0 THEN 'Sold'
WHEN PATINDEX('%STOCK%',orderstatus)>0 OR PATINDEX('%STK%[0-9]/[0-9]%',orderstatus)>0 THEN 'Stock' ELSE'' END AS comment
,CASE WHEN PATINDEX('%[0-9]/[0-9]%',orderstatus)>0 OR CHARINDEX('*',orderstatus)>0 OR CHARINDEX('BAM',orderstatus)>0
THEN 'BAM' ELSE'' END AS BAMYN
,CASE WHEN PATINDEX('%[0-9]/[0-9]%',orderstatus)>0
THEN CAST(SUBSTRING(orderstatus,CHARINDEX('/',orderstatus)-2,5)+'/2022' AS DATE)
ELSE orddate END AS soldorstockdate
FROM ##input
Subject
Written By
Posted
Converting SQL server query to mysql
May 25, 2022 09:18AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.