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 :

enter image description here

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

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -