how using mysql CAST in db_select I want to try doing Mysql Casting in my query by db_select but face to error,

$q=db_select('node','n');
          $q-&gt;join('field_data_field_cinema_type', 'fct', 'fct.entity_id = n.nid');
          $q-&gt;condition('n.type',array('movie'),'IN');
          $q-&gt;condition('fct.field_cinema_type_tid',11095,'=');
          $q-&gt;condition('cast(n.nid AS SIGNED )',11517,'&gt;'); // also $q-&gt;condition('cast(n.nid AS SIGNED INTEGER )',11517,'&gt;');
          $q-&gt;fields('n',array('nid','type'));
          ym((string)$q);
     $res= $q-&gt;orderBy('nid')-&gt;execute()-&gt;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 &gt; :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 ?
You can use the where() method for a SelectQuery:

...
$q-&gt;where('CAST(n.nid AS SIGNED) &gt; :nid', array(':nid' =&gt; 11517));
...


So the choice is yours which type of query to use.