SHARE
TWEET

Untitled

a guest Jan 21st, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2.   p.p_name,
  3.   p.id,
  4.   cat.cat_name,
  5.   p.property_type,
  6.   p.p_type,
  7.   p.address,
  8.   c.client_name,
  9.   p.price,
  10.   GROUP_CONCAT(pr.price) AS c_price,
  11.   pd.land_area,
  12.   pd.land_area_rp,
  13.   p.tagline,
  14.   p.map_location,
  15.   r.id,
  16.   p.status,
  17.   co.country_name,
  18.   p.`show`,
  19.   u.name,
  20.   p.created_date,
  21.   p.updated_dt,
  22.   o.type_id,
  23.   p.furnished,
  24.   p.expiry_date
  25. FROM
  26.   property p
  27.   LEFT OUTER JOIN region AS r
  28.     ON p.district_id = r.id
  29.   LEFT OUTER JOIN country AS co
  30.     ON p.country_id = co.country_id
  31.   LEFT OUTER JOIN property_category AS cat
  32.     ON p.cat_id = cat.id
  33.   LEFT OUTER JOIN property_area_details AS pd
  34.     ON p.id = pd.property_id
  35.   LEFT OUTER JOIN sc_clients AS c
  36.     ON p.client_id = c.client_id
  37.   LEFT OUTER JOIN admin AS u
  38.     ON p.adminid = u.id
  39.   LEFT OUTER JOIN sc_property_orientation_type AS o
  40.     ON p.orientation_type = o.type_id
  41.   LEFT OUTER JOIN property_amenities_details AS pad
  42.     ON p.id = pad.property_id
  43.   LEFT OUTER JOIN sc_commercial_property_price AS pr
  44.     ON p.id = pr.property_id
  45. WHERE p.id > 0
  46.   AND (
  47.     p.created_date > DATE_SUB(NOW(), INTERVAL 1 YEAR)
  48.     OR p.updated_dt > DATE_SUB(NOW(), INTERVAL 1 YEAR)
  49.   )
  50.   AND p.p_type = 'sale'
  51.    
  52. select count(*)
  53. from table
  54.    
  55. select any(p.p_name) as p_num, any(p.tagline) as tagline, . . .
  56.    
  57. GROUP BY
  58.   p.p_name,
  59.   p.id,
  60.   cat.cat_name,
  61.   p.property_type,
  62.   p.p_type,
  63.   p.address,
  64.   c.client_name,
  65.   p.price,
  66.   pd.land_area,
  67.   pd.land_area_rp,
  68.   p.tagline,
  69.   p.map_location,
  70.   r.id,
  71.   p.status,
  72.   co.country_name,
  73.   p.`show`,
  74.   u.name,
  75.   p.created_date,
  76.   p.updated_dt,
  77.   o.type_id,
  78.   p.furnished,
  79.   p.expiry_date
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top