SELECT `jp`.*, `ji`.`image`
FROM `jml_jquery_plugins` AS `jp`
LEFT JOIN `jml_jquery_images` as `ji`
ON `ji`.`pluginid` = `jp`.`id`
LEFT JOIN (SELECT MIN(`id`) AS `min`, `pluginid` FROM `jml_jquery_images` GROUP BY `pluginid`) AS `t`
ON `t`.`pluginid` = `jp`.`id`
WHERE `jp`.`del` != 1
AND `jp`.`lastupdate` > 0
AND (`t`.`min` = `ji`.`id` OR `ji`.`image` IS NULL)
ORDER `jp`.`name` ASC
LIMIT 20
SELECT `t`.`id`, `au`.`login`, `pu`.`login`, `t`.`task_message`, `ts`.`status`
FROM `TASK` AS `t`
LEFT JOIN `USER` AS `au` ON `au`.`id` = `t`.`author_user_id`
LEFT JOIN `USER` AS `pu` ON `pu`.`id` = `t`.`performer_user_id`
LEFT JOIN `TASK_STATUS AS `ts` ON `ts`.`id` = `t`.`status`
WHERE ...
SELECT `w`.`gym`, `t`.`name`, `c`.`name`, `w`.`sttime`, `w`.`entime`
FROM `workout` AS `w`
LEFT JOIN `trainers` AS `t` ON `t`.`id` = `w`.`trainer`
LEFT JOIN `clients` AS `c` ON `c`.`id` = `w`.`client`
WHERE `w`.`date` = CURDATE()
ORDER BY `w`.`sttime`
SELECT `m`.`V0`, `m`.`V1`, `mt`.`V0`, `mt`.`V1`, ...
FROM `members` AS `m`
LEFT JOIN `members_two` AS `mt` ON `mt`.`Owned` = `m`.`member_id`
WHERE `m`.`member_id` = :uid
LIMIT 1
myQuery->SQL->Text = (AnsiString)"SELECT f_department.CODE, f_department.NAME FROM f_department LEFT JOIN l_modules_22_department ON l_modules_22_department.CODE_2 = f_department.CODE WHERE l_modules_22_department.CODE_1 = '"
+ depBlock[i].moduleCode + (AnsiString)"'";
SELECT `id`, `date`, `name`
FROM `table`
ORDER by `date`, `id`
LIMIT 10
SELECT `id`, `name`, `date`
FROM `table`
WHERE (@Date := (SELECT `date` FROM `table` WHERE `id` = :last_id))
AND (`date` > @Date OR (`date` = @Date AND `id` > :last_id))
ORDER BY `date`, `id`
LIMIT 10