View Full Version : [SQL] Formattare nominativi di una tabella
OrcaAssassina
27-01-2008, 22:02
Ho più di 4000 utenti in una tabella
Cosi formattati:
es.
ROSSI LUIGI
è possibile formattare i nomi facendo una query nel modo seguente????
Rossi Luigi
Cioè mettere tutto il nome in piccolo tranne la prima lettera del nome e cognome
Ciao e grazieeeeeee
isAlreadyInUse
27-01-2008, 22:05
Che db?
OrcaAssassina
28-01-2008, 07:41
Che db?
SQL SERVER 2005
RaouL_BennetH
28-01-2008, 13:27
Ho più di 4000 utenti in una tabella
Cosi formattati:
es.
ROSSI LUIGI
è possibile formattare i nomi facendo una query nel modo seguente????
Rossi Luigi
Cioè mettere tutto il nome in piccolo tranne la prima lettera del nome e cognome
Ciao e grazieeeeeee
Ho tovato quest'esempio:
For reporting purposes, you also might have to change the case of your output. This is a simple task using the UPPER and LOWER functions. For example, the following query will return the employees' last and first names in mixed case:
SELECT UPPER(LEFT(FirstName, 1)) + LOWER(SUBSTRING(FirstName, 2, (LEN(FirstName) - 1))) + ' '
+ UPPER(LEFT(LastName, 1)) + LOWER(SUBSTRING(LastName, 2, (LEN(LastName) - 1)))
AS FullName
FROM Employees
Results:
FullName
---------------------------------
Nancy Davolio
Andrew Fuller
Janet Leverling
Margaret Peacock
Steven Buchanan
Michael Suyama
Robert King
Laura Callahan
Anne Dodsworth
OrcaAssassina
28-01-2008, 13:59
Mi da errore
ho un solo campo di nome "Nominativo" e la tabella "tbAtleti"
SELECT UPPER(LEFT(Nominativo, 1)) + LOWER(SUBSTRING(Nominativo, 2, (LEN(Nominativo) - 1))) FROM tbAtleti
Messaggio 208, livello 16, stato 1, riga 1
Il nome di oggetto 'tbAtleti' non è valido.
vBulletin® v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.