tenriquez199
asked on
Investing columns by rows in MS SQL
ASKER
varchar and float...
the database table doesn't not support using TWO datatype in ONE column!!
can you explain further about why (or where) you need to show the data in the way of Image 2?
can you explain further about why (or where) you need to show the data in the way of Image 2?
ASKER
Ohmggg really I dont need "JUGOS" in the column, Actually i need only the types FLOAT
In mi IMAGE 1 i have a SELECT * FROM MyTable....
And this is a result but i need some query to show something like IMAGE 2
ALMATO GOLD
0 20
2 10
It's for application in .NET
I Investigate some for PIVOT but i cant do that work PIVOT...
PLEASE HELP ME!!
In mi IMAGE 1 i have a SELECT * FROM MyTable....
And this is a result but i need some query to show something like IMAGE 2
ALMATO GOLD
0 20
2 10
It's for application in .NET
I Investigate some for PIVOT but i cant do that work PIVOT...
PLEASE HELP ME!!
ASKER
I've done something similar with PIVOT, but only managed to place a row and I need at least two rows
THIS IS THE QUERY THAT I USE!!
SELECT [Almato], [Bob Esponja],[Confrutta], [Frutte],[Gold], [Happy Day],[JC Chavez],[Maui],[Saha],[Son risa],[Tre eTop],[Vre dondo], [Good 4 You], [Total]
FROM (SELECT [Marca_pro], [IMPORTE] FROM [Sicom].[dbo].[jde11$]
where Tipo='JUGOS' and dia='3' and mes='1' )
p PIVOT (SUM([IMPORTE])
FOR [Marca_pro] IN ([Almato], [Bob Esponja],[Confrutta], [Frutte],[Gold], [Happy Day],[JC Chavez],[Maui],[Saha],[Son risa],[Tre eTop],[Vre dondo], [Good 4 You], [Total])) AS pvt;
THIS IS THE QUERY THAT I USE!!
SELECT [Almato], [Bob Esponja],[Confrutta], [Frutte],[Gold], [Happy Day],[JC Chavez],[Maui],[Saha],[Son
FROM (SELECT [Marca_pro], [IMPORTE] FROM [Sicom].[dbo].[jde11$]
where Tipo='JUGOS' and dia='3' and mes='1' )
p PIVOT (SUM([IMPORTE])
FOR [Marca_pro] IN ([Almato], [Bob Esponja],[Confrutta], [Frutte],[Gold], [Happy Day],[JC Chavez],[Maui],[Saha],[Son
ASKER
I've also tried to invest my gridview in. net but neither have been
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok
in you image 2, the what datatype are you going to use for the 2 columns??