I want to try doing Mysql Casting in my query by db_select
but face to error,
$q=db_select('node','n');
$q->join('field_data_field_cinema_type', 'fct', 'fct.entity_id = n.nid');
$q->condition('n.type',array('movie'),'IN');
$q->condition('fct.field_cinema_type_tid',11095,'=');
$q->condition('cast(n.nid AS SIGNED )',11517,'>'); // also $q->condition('cast(n.nid AS SIGNED INTEGER )',11517,'>');
$q->fields('n',array('nid','type'));
ym((string)$q);
$res= $q->orderBy('nid')->execute()->rowCount();
and query string
SELECT n.nid AS nid, n.type AS type FROM {node} n INNER JOIN {field_data_field_cinema_type} fct ON fct.entity_id = n.nid WHERE (n.type IN (:db_condition_placeholder_0)) AND (fct.field_cinema_type_tid = :db_condition_placeholder_1) AND (castn.nidASSIGNEDINTEGER > :db_condition_placeholder_2)
My question is how can I use Mysql Casting
in db_select?Is that supported in db_select or I should use db_query on EntityQuery ?