Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- currency_code | price
- usd | 50
- twd | 1570
- JPY | 5049
- SELECT * FROM product WHERE price between 0 and 1500
- SELECT * FROM product WHERE price between 0 and 1500
- AND currency_code = $selected_currency_code
- id |currency_id |price
- ----------------------------
- 1 |1 |1000
- 2 |2 |1500
- 3 |1 |1300
- currency_id | currency_name
- --------------------------------
- 1 | Dollor
- 2 | Euro
- SELECT price.id,price.price,currency_code.currency_name FROM price
- INNER JOIN currency_code ON price.currency_id = currency_code.currency_id
- WHERE price BETWEEN 0 AND 1500
- select driver.*,
- case
- when driver.rental_currency = 'HKD' then driver_rental.HKT_1_fee_full_day / 7.78
- when driver.rental_currency = 'TWD' then driver_rental.HKT_1_fee_full_day / 31.4
- when driver.rental_currency = 'CNY' then driver_rental.HKT_1_fee_full_day / 6.67
- end
- as HKT_1_fee_full_day
- from driver_rental
- left join driver
- on
- driver.email = driver_rental.email
- where
- driver_rental.HKT_1_fee_full_day between 0 and 52
- ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement