есть такие 2 запроса
SELECT DISTINCT
users.`users_id`,
users.`name`,
user_dolg.`date`,
user_dolg.`user_id`,
SUM(user_dolg.hours) AS sub_hours
FROM `user_dolg`
INNER JOIN `users`
ON users.`users_id` = user_dolg.`user_id`
WHERE user_dolg.`date` BETWEEN '" . $starttime . "' AND '" . $endtime . "'
GROUP BY users.`users_id`, users.`name`, user_dolg.`date`
и
SELECT `id` ,`off_date`, `off_id`
FROM `dayoff`
ORDER BY `off_date` ASC
пытаюсь вместе склеить
SELECT DISTINCT
users.`users_id`,
users.`name`,
user_dolg.`date`,
user_dolg.`user_id`,
SUM(user_dolg.hours) AS sub_hours
FROM `user_dolg`
INNER JOIN `users`
ON users.`users_id` = user_dolg.`user_id`
WHERE user_dolg.`date` BETWEEN '" . $starttime . "' AND '" . $endtime . "'
GROUP BY users.`users_id`, users.`name`, user_dolg.`date`
UNION
SELECT `id` ,`off_date`, `off_id`
FROM `dayoff`
ORDER BY `off_date` ASC
но пишет ошибку #1222 - Использованные операторы выборки (SELECT) дают разное количество столбцов