Add in conditions at the bottom for filtering.
SELECT
`entity`.`entity_type_code`,
`attr`.`attribute_code`,
`store`.`code` AS `store_code`,
`store`.`store_id`,
`option`.`option_id`,
`option`.`sort_order`,
`label`.`value` AS `option_label`,
`swatch`.`value` AS `option_swatch`
FROM `eav_attribute_option` AS `option`
INNER JOIN `eav_attribute_option_value` AS `label`
ON `option`.`option_id` = `label`.`option_id`
INNER JOIN `store`
ON `label`.`store_id` = `store`.`store_id`
LEFT JOIN `eav_attribute_option_swatch` AS `swatch`
ON `label`.`option_id` = `swatch`.`option_id`
AND `swatch`.`store_id` = `store`.`store_id`
INNER JOIN `eav_attribute` AS `attr`
ON `option`.`attribute_id` = `attr`.`attribute_id`
INNER JOIN `eav_entity_type` AS `entity`
ON `attr`.`entity_type_id` = `entity`.`entity_type_id`
ORDER BY
`entity`.`entity_type_code` ASC,
`attr`.`attribute_code` ASC,
`store`.`store_id` ASC,
`option`.`sort_order` ASC
;
Optional filtering:
WHERE `entity`.`entity_type_code` = 'REPLACE_WITH_ENTITY_TYPE_CODE'
AND `store`.`code` IS NOT NULL
AND `attr`.`attribute_code` = 'REPLACE_WITH_ATTRIBUTE_CODE'