SQL Error SELECT a.id,a.content_permissioning,a.name,a.meta_name,a.widget_clicks,a.popular,a.bookable,a.only_quotable,a.elevate,a.product_type,a.detailed_itinerary,a.pe_qualityscore as peRating,a.prices_available as hasPrices,a.cancellation_window,a.percent_norefund, "Prices from::US$ ::1489.00::::::1::::USD::" as productPrice,"Prices from::US$ ::1489.00::::::1::::USD::" as childPrice, a.popular_text,a.highlights,a.description as overview,a.multi_description as itinerary, a.confirmation_type, a.cutoff_time,curr.iso_code, if(a.shoreex_active=1,a.shoreex_refund_policy,0) as shoreex_refund_policy, if(a.shoreex_active=1,a.shoreex_ontime_policy,0) as shoreex_ontime_policy, a.pricing_model, a.child_age,a.child_age_max,a.senior_age,a.youth_age,a.youth_age_max,a.infant_age,a.infant_age_max, a.private_tour as private_tour, case when a.pricing_model = "By Person Type" THEN ( select group_concat(distinct(x.pricing_scheme) order by x.pricing_scheme="Participants" desc, x.pricing_scheme="Adults" desc SEPARATOR "~~~" ) from businessprofiles_productsprices as x where x.product_id=a.id) when a.pricing_model = "By Time Based" THEN ( select group_concat(distinct concat_ws("",x.amount_time," ",x.units_time) order by x.units_time="Minutes" desc,x.units_time="Hours" desc,x.amount_time SEPARATOR "~~~" ) from businessprofiles_productsprices as x where x.product_id=a.id) when a.pricing_model = "By API" THEN ( select group_concat(distinct concat_ws("",x.amount_time,"::",trim(x.room_type) ) order by x.display_price=1 desc,x.room_type="Participants" desc,x.room_type="Adults" desc,x.room_type SEPARATOR "~~~" ) from businessprofiles_productsprices as x where x.product_id=a.id) when a.pricing_model = "By Occupancy" THEN ( select group_concat(distinct concat_ws("",x.room_type,"::",x.quantity,"::",x.room_max,"::",pricing_scheme) order by x.room_type,x.quantity SEPARATOR "~~~" ) from businessprofiles_productsprices as x where x.product_id=a.id) end as pricingTypes, a.hotel_pickup, (select group_concat(distinct concat_ws("",x.name,"::",gc.name) SEPARATOR "~~~") from geography_towns as x join places_products as xy on xy.town_id=x.id join geography_regions as gr on gr.id=x.region_id join geography_countries as gc on gc.id=gr.country_id where xy.product_id=a.id) as pickupTowns, a.fb_included,food_description,beverage_description,a.lodging_included,a.lodging_description,a.lodging_type,a.other_inclusions, a.min_quantity, a.max_quantity,a.not_inclusions, a.duration_days,a.duration_hours,a.duration_minutes, a.skill_level,a.meeting_location,a.recommendations, a.disclaimer, a.restrictions,a.accessible_tag,a.accessible_notes, a.minimum_age, a.minimum_height, a.maximum_weight, a.main_photo as mainProductPhoto,b.main_photo as mainBusinessPhoto,b.travel_leaders_group as tlg,b.signature as sig, a.recs,a.bundle, b.name as businessName,b.description as businessDescription,b.id as profile_id,b.pe_certified,b.phone_number as business_phone,b.email as business_email, b.slug_name as businessSlug,a.slug_name as productSlug,gt.slug_name as townSlug, b.street_address as businessAddress,b.unique_feature as businessFeature, b.sustainable_tourism,b.sustainable_tourism_text,b.social_responsibility,b.social_responsibility_text,b.locally_owned,b.locally_owned_text,b.family_owned,b.family_owned_text, CASE when length(a.town_id) > 0 then concat_ws("",gt1.name,", ",gc1.name) WHEN length(b.town_id) > 0 THEN concat_ws("",gt.name,", ",gc.name) WHEN length(b.region_id) > 0 THEN concat_ws("",gr.name,", ",gc.name) end as tourLocation, CASE when length(a.town_id) > 0 then concat_ws("","TOWN","::",a.town_id) WHEN length(b.town_id) > 0 THEN concat_ws("","TOWN","::",b.town_id) WHEN length(b.region_id) > 0 THEN concat_ws("","REGION","::",b.region_id) WHEN length(b.country_id) > 0 THEN concat_ws("","COUNTRY","::",b.country_id) end as crumbType, case when length(a.latitude)>0 then concat_ws("",a.latitude,"::",a.longitude) WHEN length(b.latitude)>0 then concat_ws("",b.latitude,"::",b.longitude) WHEN length(gt.latitude)>0 then concat_ws("",gt.latitude,"::",gt.longitude) WHEN length(gr.latitude)>0 then concat_ws("",gr.latitude,"::",gr.longitude) WHEN length(gc.latitude)>0 then concat_ws("",gc.latitude,"::",gc.longitude) end as longlat, a.town_id, b.town_id as business_town, a.custom_mandatory,a.custom_questions, b.deposit_only, a.min_payment, a.min_payment_type, b.reservation_contactemail, ac.json as catchmentArea, "" as addOns, "" as options, group_concat(distinct concat_ws("",aced.name,"::",aced.latitude,"::",aced.longitude,"::") SEPARATOR "~~~") as hotels, GROUP_CONCAT(distinct concat_ws("", if (avail.type="Rule",avail.rule,"Specific Date") ,"::",avail.time_type,"::",avail.time,"::",avail.end_time,"::",date_format(avail.period_start,"%e %b"),"::",date_format(avail.period_end,"%e %b") ) order by avail.period_start>curdate(),avail.rule = "Monday" desc,avail.rule = "Tuesday" desc,avail.rule = "Wednesday" desc,avail.rule = "Thursday" desc,avail.rule = "Friday" desc,avail.rule,avail.time SEPARATOR "~~~" ) as availability, if (length(a.business_id)>0 and length(b.reservation_platform)>0,1,0) as check_avail, if(json_valid(availability),JSON_EXTRACT(availability, "$.dates","") AS cache_availability, GROUP_CONCAT(distinct concat_ws("",langs.id,"::",langs.name) SEPARATOR "~~~") as languages, avg(rev.rating) as avgRating, GROUP_CONCAT(distinct concat_ws("",rev.id,"::",rev.review,"::",rev.tip,"::",revu.username,"::",revb.blog_name,"::",rev.rating,"::",left(rev.entry_date,10),"::",revu.profile_img,"::",revb.slug_name,"::",rev.review_type,"::",revbp.slug_name,"::","","::","","::",rev.reviewhelpful_count,"::",revu.first_name,"::",replace(bo.traveller_names,"::","~"),"::",rev.source ) order by rev.created_on desc SEPARATOR "~~~") as reviews, GROUP_CONCAT(distinct concat_ws("",rev.id,"::",revp.file_location ) SEPARATOR "~~~") as reviewsPhotos, GROUP_CONCAT(distinct concat_ws("",fq.question,"::",fq.answer ) SEPARATOR "~~~") as faqs, GROUP_CONCAT(distinct(v.video_url ) SEPARATOR "::") as videos from businessprofiles_products as a join businessprofiles as b on a.profile_id=b.id left outer join geography_towns as gt on gt.id=b.town_id left outer join geography_regions as gr on gr.id=b.region_id left outer join geography_countries as gc on gc.id=b.country_id left outer join currencies as curr on a.currency_id=curr.id left outer join geography_towns as gt1 on gt1.id=a.town_id left outer join geography_regions as gr1 on gr1.id=gt1.region_id left outer join geography_countries as gc1 on gc1.id=gr1.country_id left outer join businessprofiles_productsavailability as avail on avail.product_id = a.id and avail.type not in ("Blackout Date","Blackout Date Rule") left outer join businessprofiles_productslanguages as lang on lang.product_id = a.id left outer join languages as langs on lang.language_id=langs.id LEFT OUTER JOIN reviews as rev on rev.product_id=a.id and lower(rev.status) like "approved%" LEFT OUTER JOIN bloggers as revb on rev.blogger_id =revb.id LEFT OUTER JOIN businessprofiles as revbp on rev.profile_id=revbp.id LEFT OUTER JOIN users as revu on rev.user_id=revu.user_id LEFT OUTER JOIN bookings as bo on bo.id=rev.booking_id LEFT OUTER JOIN photos as revp on rev.id=revp.review_id AND lower(revp.status) LIKE "approved%" LEFT OUTER JOIN faq as fq on fq.product_id=a.id and fq.category="Product FAQ" and fq.active=1 LEFT OUTER JOIN businessprofiles_productscatchment as ac on ac.product_id=a.id LEFT OUTER JOIN places_products as ace on ace.catchment_id=ac.id LEFT OUTER JOIN places as aced on aced.id=ace.place_id LEFT OUTER JOIN videos as v on v.product_id=a.id where b.content_permissioning="All" and ( a.content_permissioning="All" or a.content_permissioning="Quote") and a.id = 30309 group by a.id: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS cache_availability, GROUP_CONCAT(distinct concat_ws(""' at line 69 -->
Project Expedition
Manage Bookings

Overview

Activities

Highlights

Description

Complimentary Options

Add Ons

Itinerary

Meeting Location

Inclusions

Requirements

FAQs

Verified Reviews

About the Operator

Tours you may like