Hello,
I want to make a request like "transform access request".
I have a simple table with and unique id + a value between 1 to 20, and this
n times.
I want to create a table with id + 1 col and insert into the id and all the
value in one row.
Summary, I want to transform rows in cols... like a sumary report...
How can I do ( I don't have stored proc ;-((((( )
Thanks 3 1630
An example would be really helpful. I am slow, couldnt make sense out of
your note.
Thanks
Aakash
"gin" <gi*@wanadoo.fr> wrote in message
news:bn**********@news-reader1.wanadoo.fr... Hello,
I want to make a request like "transform access request". I have a simple table with and unique id + a value between 1 to 20, and
this n times. I want to create a table with id + 1 col and insert into the id and all
the value in one row. Summary, I want to transform rows in cols... like a sumary report... How can I do ( I don't have stored proc ;-((((( )
Thanks
This is a little exemple :
What I have :
table product
col product_name, col prix
product A, 1?
product A, 2?
product A, 3?
product B, 1?
product B, 4?
product C, 5?
I want :
Table summary:
col product_name, prix_summary
product A, 1?;2?;3?
product B, 1?;4?
product C, 5?
"Aakash Bordia" <a_******@hotmail.com> a écrit dans le message de
news:bn**********@hanover.torolab.ibm.com... An example would be really helpful. I am slow, couldnt make sense out of your note. Thanks Aakash
"gin" <gi*@wanadoo.fr> wrote in message news:bn**********@news-reader1.wanadoo.fr... Hello,
I want to make a request like "transform access request". I have a simple table with and unique id + a value between 1 to 20, and this n times. I want to create a table with id + 1 col and insert into the id and all the value in one row. Summary, I want to transform rows in cols... like a sumary report... How can I do ( I don't have stored proc ;-((((( )
Thanks
Try this :
with t(prod,prix,seq) as (
select prod
,prix
,rank() over (partition by prod order by prix) seq
from prod)
select prod
,sum(case when (seq=1) then prix else NULL end)
,sum(case when (seq=2) then prix else NULL end)
,sum(case when (seq=3) then prix else NULL end)
from t
group by prod
;
Jacques
"gin" <gi*@wanadoo.fr> wrote in message news:<bo**********@news-reader4.wanadoo.fr>... This is a little exemple :
What I have :
table product col product_name, col prix product A, 1? product A, 2? product A, 3? product B, 1? product B, 4? product C, 5?
I want : Table summary: col product_name, prix_summary product A, 1?;2?;3? product B, 1?;4? product C, 5? "Aakash Bordia" <a_******@hotmail.com> a écrit dans le message de news:bn**********@hanover.torolab.ibm.com... An example would be really helpful. I am slow, couldnt make sense out of your note. Thanks Aakash
"gin" <gi*@wanadoo.fr> wrote in message news:bn**********@news-reader1.wanadoo.fr... Hello,
I want to make a request like "transform access request". I have a simple table with and unique id + a value between 1 to 20, and this n times. I want to create a table with id + 1 col and insert into the id and all the value in one row. Summary, I want to transform rows in cols... like a sumary report... How can I do ( I don't have stored proc ;-((((( )
Thanks
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Alex Vinokur |
last post by:
Functor-parameters in the for_each() and transform() algorithms are passed by value.
Might it make sense to have also algorithms for_each2() and transform2()
which pass Functor-parameters by...
|
by: Xiaolei Li |
last post by:
first off, i'm a total newbie at this stuff so excuse any wrong usage of
terminology or whatever else.
i have a XSL to transform a Document such that all "text" nodes will
have a "SPAN" inserted...
|
by: John Lehmann |
last post by:
I have an interesting problem. I am performing an XSL
transform using the System.Xml.Xsl.Transform class.
I have a database that contains the XSL style sheet
string. And it seems to work pretty...
|
by: Patrick Guio |
last post by:
Dear all,
I am trying to use the std::transform algorithm to to the following
vector< vector<char> >::iterator ik = keys.begin(); // key list iterator
vector< vector<char> >::iterator is = ik;...
|
by: Stephen Cook |
last post by:
Having worked through the problems around enabling the document function
using an XmlUrlResolver I started work on building a useful class to hide
the intricacies.
Trying to generalise the process...
| |
by: Jason S |
last post by:
Hello Group,
I am just about tearing my hair out with this one and thought someone may
have some insight. I have a transform that wasn't working so I grabbed the
nearest debugger (xselerator)...
|
by: schneider |
last post by:
Anyone know if there is a way to dynamicly create a Xslt template/s and use
them as an
xml transform with-out use files for the Xslt?
All the methods I see use files.
I want to create a Xslt...
|
by: Mike Hofer |
last post by:
I've got two statements in my code that are both generating weird,
weird, weird messages:
The first one was,
Dim document As System.Xml.XmlDocument
Dim navigator As...
|
by: Dean Card |
last post by:
Okay, so here is the situation. I have need to do some on-the-fly image
creation. I have everything working great except for the last part of it,
applying a perspective type transform to the...
|
by: Vijai Kalyan |
last post by:
Hello,
I am trying to use std::transform to take in a collection of strings,
transform them and insert the result into an output container. So, I
wrote something like this:
std::wstring...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |