sql server - Formatting column data type directly in the query -
so, i've got little problem: made select show specific data , it
select zona, sum(etotal) total ft (nolock) group zona
what intend able see total values €
values. best way reach directly query?
this type of formatting should done in application layer.
with sql server 2012+
use format
:
select zona, total = format(sum(etotal), '########.##€') ft (nolock) group zona;
or:
select zona, total = format(sum(etotal), 'c', 'de-de') ft (nolock) group zona;
warning:
i hope understand how nolock
works (possible dirty reads/...).
Comments
Post a Comment