
SELECT 
 `runranges`.`id`   AS `runRangeId`, 
 `assignments`.`id` AS `asId`,
 UNIX_TIMESTAMP(`assignments`.`created`) as `asCreated`,
 UNIX_TIMESTAMP(`assignments`.`modified`) as `asModified`,
 `variations`.`id`  AS `varId`,
 `variations`.`name`  AS `varId`,
 `constantsets`.`id` AS `constId`,
 `constantsets`.`vault` AS `blob`,
 `constanttypes`.`id` AS `typeId`
 
FROM `runranges` 
   INNER JOIN `assignments` ON `assignments`.`runRangeId`= `runranges`.`id`
   INNER JOIN `variations` ON `assignments`.`variationId`= `variations`.`id`
   INNER JOIN `constantsets` ON `assignments`.`constantSetId` = `constantsets`.`id`
   INNER JOIN `constanttypes` ON `constantsets`.`constantTypeId` = `constanttypes`.`id`
WHERE 
      `runranges`.`runMin` < '121' 
  AND `runranges`.`runMax` > '121' 
  AND `variations`.`name`="default"
  AND `constanttypes`.`id` = 1

ORDER BY `assignments`.`time` ASC
LIMIT 0,1; #set x of number 
