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

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -