select `r`.`id` as `req`, `ss`.`user_id` as `user`, `ss`.`created_at` as `date`
from (
select `user_id`, min(`created_at`) as `min_date`
from `seo_source`
group by `user_id`
) as ss
right join `seo_user_request` as `su` on `su`.`user_id` = `ss`.`user_id`
left join `request` as `r` on `r`.`id` = `su`.`request_id`
strcpy(char_ptr, "Thes is memory is located in the heap.");
Если выделено меньше, чем длина вашей строки +1, то остаток строки записывается в произвольное место, вызывая ошибку. SELECT `sa_real`.*
FROM (
SELECT DISTINCT `location_id_fk`
FROM `sa_metro_house`
WHERE `metro_id_fk` IN (4,7,6)
) AS `t`
JOIN `sa_real` ON `sa_real`.`house_location_id_fk` = `t`.`location_id_fk`
SELECT *
FROM `sa_real`
WHERE `house_location_id_fk` IN (
SELECT `location_id_fk`
FROM `sa_metro_house`
WHERE `metro_id_fk` IN (4,7,6)
)
int main(void)
{
DDRD = 0xFF;
PORTD = 0x00;
char position = 0;
char step = -1;
while(1) {
PORTD = (1 << position);
if (0 == position || 7 == position) {
step = -step;
}
position += step;
_delay_ms(200);
}
}
SELECT `t`.`id_project`, `p`.`title`, `t`.`task_count`,
`t`.`task_lose`, `t`.`task_active`
FROM (
SELECT `id_project`, COUNT(*) AS `task_count`,
SUM(`status` = '1' AND `deadlines` < :TIME) AS `task_lose`,
SUM(`status` = '1') AS `task_active`
FROM `tasks`
GROUP BY `id_project`
) AS `t`
RIGHT JOIN `projects` AS `p` ON `p`.`id` = `t`.`id_project`
ORDER BY `t`.`task_lose` DESC, `t`.`task_active` DESC,
`t`.`task_count` DESC