1

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 .......
2
  • Welcome to Drupal Answers! Are you sure you need to achieve it that way? What are you trying to do, exactly?
    – apaderno
    Jul 28 '15 at 5:45
  • I want to create store procedure via .install file.
    – AmitKP
    Jul 28 '15 at 5:47
1

It has been solved using.

function hook_install(){

db_query("CREATE PROCEDURE xyz()

BEGIN set @num := 0, @termid := 0; ......................................");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.