How can I process following query structure in drupal 7.
set @num := 0, @termid := 0;
SELECT * FROM (SELECT tid,nid,created,
@num:=IF(@termid = tid, @num + 1, 1) AS row_number,
@termid:=tid AS termid .......
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityHow can I process following query structure in drupal 7.
set @num := 0, @termid := 0;
SELECT * FROM (SELECT tid,nid,created,
@num:=IF(@termid = tid, @num + 1, 1) AS row_number,
@termid:=tid AS termid .......
It has been solved using.
function hook_install(){
db_query("CREATE PROCEDURE xyz
()
BEGIN set @num := 0, @termid := 0; ......................................");