so i have 2 table
Activity table (Order Number, Event Name)
and order table (Order Number, Order status
and i want to make something like this
Order Number | Activity Valid | Column C |
---|---|---|
1 | if event name =x, then show y | if activity_valid=y then show Z |
with table_1 as(
Select Order_Number,
Event_Name
From Activity
> ),
Table_2 as(
Select order_Number,
Order_Status
From Order
> )
Select A.Order_Number,
if(Event_Name=x,Y,Y1) as Activity_Valid
if(Activity_Valid=Y,Z,Z1) as Column C
From Table_1 A Left Join Table_2 B
on A.Order_Number=B.Order_Number
the syntax for Column C is invalid, how can i achieve the correct one?
New contributor
Edbert Suryadi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.