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; 

livedemo

or:

select zona,         total = format(sum(etotal), 'c', 'de-de') ft (nolock)  group zona; 

livedemo2

warning:

i hope understand how nolock works (possible dirty reads/...).


Comments

Popular posts from this blog

android - net_scheduler holding wakelock -

sql - MySQL : Getting Entries from a many-to-many table -

java - Retrieving data from database using jsp (Hibernate + Spring + Maven) -