how to do sum,subtract functions in Group_Concat in mysql -


i generating report show outstanding fee fee type,how amount fixed fee type, how amount paid fee type , balance amount paid fee type.

here pulling data 5 tables class names classes table, roll no & student name admissions table, fee types feevars table, amount fixed fee type studentfees table, , amounts paid fee types fee collection table.

i able generate partial results mentioning fee type names in select statment summing , subtracting operations.

here full database , query producing result. plz **@ mysql query in select statement have mentioned fee types manually. want generate result without mentioning fee type column names.

for did 1 thing, had taken fee types sql variable this

set @sqllist = null;select group_concat(concat('tsf.', replace(feename,' ',''))) @sqllist tbl_feevars; 

this result fee types single line column names. , have written code produce output expecting, getting error error code 1064: have error in sql syntax.

this final code

expected output code

please tell me, error in sql query. , suggest me if any?? other way report.

what desired output ?

i have made working in didle http://www.sqlfiddle.com/#!2/a26c7/15

i think, @ not good... moreover, want use arrays... there's no such thing arrays in mysql have use loop simulate array or tmp table. see question answer 4u:

how can simulate array variable in mysql?


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -