AM NEW TO MYSQL... HELP ME TO SORT OUT THIS...
I have a result like
NO, TYPE, FEE_AMT
'2156', 'FTP2', 100.00
'2156', 'FTP4', 200.00
'2156', 'FTP5', 100.00
'2156', 'FTP6', 100.00
'2156', 'FTP3', 100.00
I want to sum all FEE_AMT, in which if the type='FTP5' I want to square the respective FEE_AMT and then add... I have tried sum(fee_amt) only...
EXPECTED OUTPUT IS: 10,500...
edit
100+200+(100*100)+100+100
I WANT TO SQUARE THE FEE AMOUNT IF FEE TYPE='FTP5'
THANKS IN ADVANCE... :)
10,500from your question. Do you want the sum of the squares, or the square of the sum?