mysql - SQL returning string instead table -
i having sql command:
select company, purchases.stock,sum(ammount)*price purchases inner join curstock on purchases.stock = curstock.stock group company , purchases.stock;
which returns following table :
is possible print instead of table strings like: "company xxx owns yyy in zzz stock."
or sql not provide such formatting , has done in code.
you can use concat() function
select concat('company ', company, ' owns ', sum(ammount)*price, ' in ', purchases.stock, ' stock.') value purchases inner join curstock on purchases.stock = curstock.stock group company , purchases.stock;
wiki
Comments
Post a Comment