0
declare variable varchar (50);
declare  loopcount int;
declare i int;
declare GrouPID int ;
set variable=(SELECT GROUP_CONCAT(DISTINCT groupId)
FROM EventList_View);
 SET loopcount=
  (select LENGTH(variable) - LENGTH(REPLACE(variable, ',', ''))); 
      select   loopcount;   

in variable i am getting data '1,6,8' but when i try to count length i am getting null, even i have declare all variable.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Mhanaz Syed
  • 229
  • 1
  • 5
  • 18
  • http://stackoverflow.com/questions/3653462/is-storing-a-delimited-list-in-a-database-column-really-that-bad/3653574 – e4c5 Nov 18 '16 at 12:52

1 Answers1

0

I think your GROUP_CONCAT, requires a GROUP BY in the query. Are you not getting any errors?