I have just started with MySQL and have been thrown in at the deep end.
I have an existing site that requires a datafeed to a third party.
My problem - I am trying to extract selective data from multiple tables - which I have used the following
SELECT t_listings.f_prop_id, t_listings.f_prop_heading, t_area.f_area_name, t_listings.f_prop_postcode, t_listings.f_prop_desc, t_listings.f_prop_descmore, t_listings.f_office_id, t_propstatus.f_propstatus_desc, t_listings.f_prop_bedrooms, t_listings.f_prop_price, t_listings.f_prop_show, t_listings.f_prop_id, t_listings.f_prop_id, t_listings.f_prop_id, t_listings.f_prop_id
FROM t_listings, t_area, t_propstatus
WHERE f_prop_postcode <> '' AND f_prop_bedrooms <> '' AND f_prop_show = '1' AND f_type_id <> '135' AND t_listings.f_area_id = t_area.f_area_id AND t_propstatus.f_propstatus_desc = 'For Sale'
I now need to include a further field in my output file that includes
f_prop_heading(address), f_prop_postcode(postcode) from t_listings
and
f_area_name(town) from t_area
in the order address, postcode, town
I've been UNION without success
Any help on this would be appreciated
llegion
I have an existing site that requires a datafeed to a third party.
My problem - I am trying to extract selective data from multiple tables - which I have used the following
SELECT t_listings.f_prop_id, t_listings.f_prop_heading, t_area.f_area_name, t_listings.f_prop_postcode, t_listings.f_prop_desc, t_listings.f_prop_descmore, t_listings.f_office_id, t_propstatus.f_propstatus_desc, t_listings.f_prop_bedrooms, t_listings.f_prop_price, t_listings.f_prop_show, t_listings.f_prop_id, t_listings.f_prop_id, t_listings.f_prop_id, t_listings.f_prop_id
FROM t_listings, t_area, t_propstatus
WHERE f_prop_postcode <> '' AND f_prop_bedrooms <> '' AND f_prop_show = '1' AND f_type_id <> '135' AND t_listings.f_area_id = t_area.f_area_id AND t_propstatus.f_propstatus_desc = 'For Sale'
I now need to include a further field in my output file that includes
f_prop_heading(address), f_prop_postcode(postcode) from t_listings
and
f_area_name(town) from t_area
in the order address, postcode, town
I've been UNION without success
Any help on this would be appreciated
llegion