SELECT node.created AS node_created, node.nid AS nid
FROM
{node} node
WHERE (( (node.status = '1') AND (node.type IN ('facebook', 'instagram', 'tweet', 'youtube')) AND (node.type IN ('facebook', 'instagram', 'youtube')) ))
ORDER BY node_created AND node.type ASC
LIMIT 12 OFFSET 0