WordPress database error: [Table 'natuhqqt_wp763.wp3t_byt_tour_schedule' doesn't exist]
SELECT IFNULL(MIN(the_date), 0) min_date
FROM
(
SELECT DISTINCT (avc.number_of_available_places - IFNULL(bc.number_of_booked_places, 0)) available_places, avc.the_date, avc.price FROM
(
SELECT SUM(max_people) number_of_available_places, possible_dates.the_date, price
FROM wp3t_byt_tour_schedule availabilities
INNER JOIN (
select d.the_date from
(
select adddate('2024-11-16',t4.i*10000 + t3.i*1000 + t2.i*100 + t1.i*10 + t0.i) the_date from
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t0,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t1,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t2,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t3,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t4
having the_date between '2024-11-16' and '2029-01-16'
ORDER BY the_date
) d
where DATE(d.the_date) > DATE(CURDATE())
group by d.the_date
order by d.the_date
) possible_dates ON possible_dates.the_date = DATE(availabilities.start_date) AND availabilities.end_date IS NULL
WHERE availabilities.tour_id = 1841 GROUP BY possible_dates.the_date, availabilities.price
) as avc
LEFT JOIN
(
SELECT SUM(bookings.adults + bookings.children) number_of_booked_places, possible_dates.the_date booking_date
FROM wp3t_byt_tour_booking bookings
INNER JOIN (
select d.the_date from
(
select adddate('2024-11-16',t4.i*10000 + t3.i*1000 + t2.i*100 + t1.i*10 + t0.i) the_date from
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t0,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t1,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t2,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t3,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t4
having the_date between '2024-11-16' and '2029-01-16'
ORDER BY the_date
) d
where DATE(d.the_date) > DATE(CURDATE())
group by d.the_date
order by d.the_date
) possible_dates ON possible_dates.the_date = DATE(bookings.tour_date)
WHERE bookings.tour_id = 1841 AND IFNULL(bookings.woo_status, '') IN ('completed') GROUP BY possible_dates.the_date
) as bc
ON bc.booking_date = avc.the_date
HAVING available_places > 0
) as pr
WordPress database error: [Table 'natuhqqt_wp763.wp3t_byt_tour_schedule' doesn't exist]
SELECT IFNULL(MIN(price), 0) min_price
FROM
(
SELECT DISTINCT (avc.number_of_available_places - IFNULL(bc.number_of_booked_places, 0)) available_places, avc.the_date, avc.price FROM
(
SELECT SUM(max_people) number_of_available_places, possible_dates.the_date, price
FROM wp3t_byt_tour_schedule availabilities
INNER JOIN (
select d.the_date from
(
select adddate('2024-11-16',t4.i*10000 + t3.i*1000 + t2.i*100 + t1.i*10 + t0.i) the_date from
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t0,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t1,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t2,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t3,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t4
having the_date between '2024-11-16' and '2026-11-16'
ORDER BY the_date
) d
where DATE(d.the_date) > DATE(CURDATE())
group by d.the_date
order by d.the_date
) possible_dates ON possible_dates.the_date = DATE(availabilities.start_date) AND availabilities.end_date IS NULL
WHERE availabilities.tour_id = 1841 GROUP BY possible_dates.the_date, availabilities.price
) as avc
LEFT JOIN
(
SELECT SUM(bookings.adults + bookings.children) number_of_booked_places, possible_dates.the_date booking_date
FROM wp3t_byt_tour_booking bookings
INNER JOIN (
select d.the_date from
(
select adddate('2024-11-16',t4.i*10000 + t3.i*1000 + t2.i*100 + t1.i*10 + t0.i) the_date from
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t0,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t1,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t2,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t3,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t4
having the_date between '2024-11-16' and '2026-11-16'
ORDER BY the_date
) d
where DATE(d.the_date) > DATE(CURDATE())
group by d.the_date
order by d.the_date
) possible_dates ON possible_dates.the_date = DATE(bookings.tour_date)
WHERE bookings.tour_id = 1841 AND IFNULL(bookings.woo_status, '') IN ('completed') GROUP BY possible_dates.the_date
) as bc
ON bc.booking_date = avc.the_date
HAVING available_places > 0
) as pr