Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I need to implement the following PostgreSQL query by means of Talend:
select *, (case
when product_reviews.product not like '%[^0-9]%' then cast(product_reviews.product as varchar)
when product_reviews.product like '%@%' then cast((select product_details.product_code from product_details where lower(product_reviews.product) = lower(product_details.product_ID)) as varchar)
else cast((select product_details.product_code from product_details where lower(product_reviews.product) = lower(product_reviews.product_name)) as varchar)
end) as product_code;
from product_reviews;
Hi,
what is your question (problem) exactly?
btw, at least one error there:
select XXXX, XXXX) as product_code; from product_reviews;
you have wrong ; after as product_code
cheers