Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- EXPLAIN select city_id,
- id,
- name,
- id1,
- name1,
- id2,
- name2,
- price,
- currency,
- price_unit,
- dayrazm
- from (select b.city_id AS city_id,
- b.type_id AS id,
- bt.strname AS name,
- b.main_id AS id1,
- MAX(CASE WHEN bp.name = 'location' THEN `value` END) AS name1,
- MAX(CASE WHEN bp.name = 'side' THEN `value` END) AS id2,
- CONCAT('storona ', MAX(CASE WHEN bp.name = 'side' THEN `value` END)) AS name2,
- IF(MAX(CASE WHEN bp.name = 'price' THEN `value` END) = 'n/d', NULL,
- MAX(CASE WHEN bp.name = 'price' THEN `value` END)) AS price,
- 1 AS currency,
- 'rpm' AS price_unit,
- 14 AS dayrazm
- from outdoor.build AS b
- JOIN outdoor.build_property AS bp ON bp.build_id = b.id
- JOIN outdoor.build_types AS bt ON bt.alias_id = b.type_id
- WHERE b.alive = 1
- GROUP BY b.id) AS od
- where od.city_id = 25
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement