How so I execute $query->orderBy('FIELD(node.nid, 5,12,3,6)', 'ASC')?
I did a workaround by implementing a CASE statement then sorting by the value.

$query-&gt;addExpression("
    CASE node.nid
        WHEN 5 THEN 1
        WHEN 12 THEN 2
        WHEN 3 THEN 3
        WHEN 6 THEN 4
        ELSE 5
    END
", 'order_field');

$query-&gt;orderBy("order_field", 'ASC');


Hopefully they'll add another function to handle these special statements in the future.