Only getting one result from sub select in inner join in mysql -
Hello I'm in a dilemma, I am querying this:
SELECT GROUP_CONCAT (DISTINCT (ca.category_name) SEPARATOR ',') categories, pr.promo_name, pr.add_value_text, c.contract_id, c.cmeal_plan, c.cmin_markup, c.civa, c.tax_include, c.hotel_id, hi. hname as well as, hi.hstars, im.image_file, pl.plan_name, as ra.price contract woe as C inner hotel_info which hi.hotel_id = c.hotel_id and hi.destination_id = '6460' Internal images included as im on im.foreign_id = hi.hotel_id Internal meal_plan included but only pl.plan_code = c.cmeal_plan and pl.lang = p L '1' internal hotel_categories join hc.hotel_id = hi.hotel_id intermediate categories when hc join ca.category_code = hc as CA Category_code and ca.lang = '1' Left Join (Select r.hotel_id, average (Arkdblukpi.al.) As of As Price R) RA as the value of ra.hotel_id = hi. Hotel_id as PROVENCE PRO. Hi.hotel_id and FIND_IN_SET (c.contract_id, pr.contract_id) & gt; 0 more P.Book_start & lt; = '2012-11-01' and Pvt. Book_end & gt; = '2012-11-02' and travel_start & lt; = '2012-11-23' and travel_and & gt; = '2012-11 -30' and pr.lang = '1' where c cstart and lt; = '2012-11-01' and c.cend & gt; = '2012-11-01' and hi.status = '1' and IM type = '1' group by hi.hotel_id I get all the desired results in addition to all the selection queries .. Every hotel has a price but it only gives me a result and the rest are all there is an error in my query? If any additional information is required please let me know and thank you in advance for any help!
GROUP BY is missing in your subquery, so MySQL is only a one-value will return if you all want Hotl_aids you need GROUP bY to the region: SELECT GROUP_CONCAT (DISTINCT (ca.category_name) SEPARATOR ',') ASC as categories PROMO_NAME, pr.add_value_text, c.contract_id, c.cmeal_plan, c.cmin_markup, c.civa, c.tax_include, c.hotel_id, hi.hname, hi.hstars, im.image_file, pl. As soon as the inside of the hotel_info is included in the form of a ra.price contract from plan_name, hi.hotel_id = c.hotel_id and hi.destination_id = '6460' internal image Not as involved in the internal as im.foreign_id = hi.hotel_id meal_plan on iM which pl.plan_code on pl = c.cmeal_plan Hi pl.lang = '1' hc.hotel_id as internal hotel_categories hc = Hi.hotel_id Join Inner categories but ca.category_code = hc.category_code and ca.lang = CA as '1' Left JOIN (r.hotel_id, select average (rw. Double) Enter the hotel with the price of the Hotel as Price of ROSLLHLL by ASR Group - For every hotel you will get average () RA on RA Pr.hotel_id = hi.hotel_id and FIND_IN_SET on AS PR (C. Contract_id, pr.contract_id) & gt; 0 more P.Book_start & lt; = '2012-11-01' and Pvt. Book_end & gt; = '2012-11-02' and travel_start & lt; = '2012-11-23' and travel_and & gt; = '2012-11 -30' and pr.lang = '1' where c cstart and lt; = '2012-11-01' and c.cend & gt; = '2012-11-01' and hi.status = '1' and IM type = '1' group by hi.hotel_id
Comments
Post a Comment