I have a table like this
id | item | price | vip ---+--------+--------+----- 0 | tv | 2000 | NULL 1 | tv | 2500 | TRUE 2 | camera| 3000 | NULL 3 | camera| 3500 | TRUE 4 | phone | 1000 | NULL 5 | pen | 2 | NULL
In this table, I have duplicate entries because I need to store the vip value. If an ordinary person visits, I need to show
item | price ------+--------- tv | 2000 camera| 3000 phone | 1000 pen | 2
If a vip person comes, I have to show the price as
item | price ------+----------- tv | 2500 camera| 3500 phone | 1000 pen | 2
The last column is a boolean.
I need a request to get items. Please help get an inquiry for this.
source share