Take a look at this SQL FIDDLE: LINK
There exist a table called "clients" that contains information related to clients:
The relation is "account number" - "client name"
and i used this sentence in order to obtain the name of the client:
LEFT JOIN clients c ON ppc.customer_number = c.account_number
I do not want to join the table clients anymore, but i want to obtain the same result, do you get me?.
I mean, i need this output:
{"sku":"99342435","PRICE":"9999",PRICES_FOR_CLIENTS:[{"group":"A","PRICE":"29223"},{"group":"B","PRICE":"33223"},{"group":"SUPERMARKET","PRICE":"48343"},{"group":"WALMART","PRICE":"40340"}]};
Somehow i would need to hard-code the values related to the account_number, i.e:
If account_number = 112121 replace it by WALMART
and if the account_number = 119435 replace it by SUPERMARKET
I tried to do it but i failed.
Can you help me?
LEFT JOINyou’ll need to update yourDECODEstatement to use hard coded values instead of c.description. Remember to update the group by as well.