MySQL function declare 2 variables with one select -
i'd know how can create mysql function declares 2 variables using 1 select statement. this:
create function `inhashtagcampaign` (campaignid int,startdatetime datetime,enddatetime datetime) returns text language sql deterministic begin declare result text; declare limit bigint(11); declare suspended tinyint(1); # #i don't know how this, i'd use result of query: # result = select `limit`,`suspended` `settings` `campaignid` = 2; limit = result.limit; suspended = result.suspended; end;
i know function far complete, i'm kinda stuck on thing already.
i think trying this
declare @limit bigint(11); declare @suspended tinyint(1); select @limit := `limit`, @suspended := `suspended` `settings` `campaignid` = 2;
(or)
declare limit1 bigint(11); declare suspended1 tinyint(1); select `limit`,`suspended` limit1, suspended1 `settings` `campaignid` = 2;
Comments
Post a Comment