![]() ![]() ![]() When 'Used' and t2.expose_used = 2 then 2 When 'Used' and t2.expose_used = 1 then 1 I am not sure that I can have the addition of another test with the AND in each WHEN statement but it does not give an error, only the wrong result. Here is a CASE version that actually seems to execute but always results in the first value no matter what happens to be true (in this case 1). ![]() Join manufacturers t2 on t2.id = t1.seller (select expose_used from manufacturers where id = t1.seller),1 (select expose_new from manufacturers where id = t1.seller),1 I have tried this with CASE statements and the following WRONG IF/ELSEIF statement.Īny help to debugger this and point me in the right direction would be appreciated. The following does not work, but you will get the idea of what I am trying to do. I need this single digit on a per-product basis to conditionally display it in a list. What I am trying to get is the item details and the computed value for where it can be seen based on whether it is new or used and the rule/value assigned to the manufacturer for all their new or used products. When the videos are added, they are not assigned an 'expose' value and this is meant to be done on the fly when adding them to our index depending on the current manufacturer's expose_new or expose_used values. I am trying to make a query that tells me where the product can be viewed based on the settings in the manufacturer table.įor example, in the manufacturer table, there are two fields called expose_new and expose_used each of which will have a value of 1,2 or 3 to limit where their new or used videos can seen. This is like Netflix have videos in their system that can only be viewed Everywhere (1), only in Canada (2), only in USA (3). We have to limit visibility of the product based on the regions. One has manufacturer information and includes the regions where they can sell. ![]()
0 Comments
Leave a Reply. |