Jump to content

[Resolvido] colocar unidade na query


jafm
 Share

Recommended Posts

Ok,

A minha query é antiga , ou seja, sem unidade de medida é esta

--SELECT Site.Nome, Cast(COUNT(Cliente.LOJA) as nvarchar) +' imi' as total 
SELECT Site.Nome, COUNT(Cliente.LOJA) as total 
FROM Cliente INNER JOIN
Site ON Cliente.LOJA = Site.Loja
Group by Cliente.LOJA, Site.Nome
order by total desc

o que eu pretendo é colocar as frente de total a unidade de medida exemplo 'imi'

Link to comment
Share on other sites

Isto deverá funcionar.

SELECT Nome, CAST(Total AS NVARCHAR) + ' imi' FROM
(
SELECT TOP 100 PERCENT Site.Nome, COUNT(Cliente.LOJA) as total
FROM Cliente INNER JOIN
Site ON Cliente.LOJA = Site.Loja
Group by Cliente.LOJA, Site.Nome
order by total desc
) A
Edited by Rechousa

Pedro Martins

Sharing is Knowledge!

http://www.linkedin.com/in/rechousa

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.