Untitled

 avatar
unknown
plain_text
2 years ago
3.5 kB
4
Indexable
SELECT 
  count(*) AS count_1 
FROM 
  (
    SELECT 
      property_sov_input.id AS property_sov_input_id, 
      property_sov_input.loc_id AS property_sov_input_loc_id, 
      property_sov_input.property_id AS property_sov_input_property_id, 
      property_sov_input.quote_id AS property_sov_input_quote_id, 
      property_sov_input.address_id AS property_sov_input_address_id, 
      property_sov_input.inception_date AS property_sov_input_inception_date, 
      property_sov_input.floor_area AS property_sov_input_floor_area, 
      property_sov_input.number_of_buildings AS property_sov_input_number_of_buildings, 
      property_sov_input.number_of_stories AS property_sov_input_number_of_stories, 
      property_sov_input.year_built AS property_sov_input_year_built, 
      property_sov_input.occupancy_type_id AS property_sov_input_occupancy_type_id, 
      property_sov_input.construction_type_id AS property_sov_input_construction_type_id, 
      property_sov_input.tiv_building AS property_sov_input_tiv_building, 
      property_sov_input.tiv_contents AS property_sov_input_tiv_contents, 
      property_sov_input.tiv_business_interruption AS property_sov_input_tiv_business_interruption, 
      property_sov_input.tiv_total AS property_sov_input_tiv_total 
    FROM 
      property_sov_input 
      JOIN occupancy_type ON occupancy_type.id = property_sov_input.occupancy_type_id 
      JOIN construction_type ON construction_type.id = property_sov_input.construction_type_id 
      JOIN address ON address.id = property_sov_input.address_id 
      JOIN country ON country.id = address.country_id 
      LEFT OUTER JOIN county ON county.id = address.county_id 
      LEFT OUTER JOIN state ON state.id = address.state_id
  ) AS anon_1 
SELECT 
  property_sov_input.id AS property_sov_input_id, 
  property_sov_input.loc_id AS property_sov_input_loc_id, 
  property_sov_input.quote_id AS property_sov_input_quote_id, 
  address.street_name AS address_street_name, 
  address.postal_code AS address_postal_code, 
  address.city AS address_city, 
  county.name AS county, 
  state.code AS state, 
  country.code AS country, 
  address.longitude AS address_longitude, 
  address.latitude AS address_latitude, 
  property_sov_input.inception_date AS property_sov_input_inception_date, 
  property_sov_input.floor_area AS property_sov_input_floor_area, 
  property_sov_input.number_of_buildings AS property_sov_input_number_of_buildings, 
  property_sov_input.number_of_stories AS property_sov_input_number_of_stories, 
  property_sov_input.year_built AS property_sov_input_year_built, 
  occupancy_type.code AS occupancy, 
  construction_type.code AS construction, 
  property_sov_input.tiv_building AS property_sov_input_tiv_building, 
  property_sov_input.tiv_contents AS property_sov_input_tiv_contents, 
  property_sov_input.tiv_business_interruption AS property_sov_input_tiv_business_interruption, 
  property_sov_input.tiv_total AS property_sov_input_tiv_total 
FROM 
  property_sov_input 
  JOIN occupancy_type ON occupancy_type.id = property_sov_input.occupancy_type_id 
  JOIN construction_type ON construction_type.id = property_sov_input.construction_type_id 
  JOIN address ON address.id = property_sov_input.address_id 
  JOIN country ON country.id = address.country_id 
  LEFT OUTER JOIN county ON county.id = address.county_id 
  LEFT OUTER JOIN state ON state.id = address.state_id 
LIMIT 
  %(param_1) s OFFSET %(param_2) s { 'param_1' : 100, 
  'param_2' : 0}
Editor is loading...