Answer the question
In order to leave comments, you need to log in
How to change the display of data in a SQL query?
There is a request
select idSklada, kolVoDetalei from magazin
The problem is that warehouses are returned in a column one under the other, but it is required that they be in a row.
Now
idSklada || kolVoDetalei
1 || 3
1 || 4
1 || 5
2 || 3
2 || 4
3 || 5
Requires
idSklada || kolVoDetalei -----------idSklada || kolVoDetalei --------------idSklada || kolVoDetalei
---------1 || 3--------------------------------- 2 || 3------------------------------------ 3 || 5
---------1 || 4 ---------------------------------2 || 4
----------1 || 5
It is possible through subqueries:
Make 3 subqueries, and then combine them into one.
But the problem is that the user selects the number of warehouses on the form. It will be necessary to generate requests in C#. This is not a problem for me, I can write, but I want to write so that the code is beautiful.
Is it possible to do this in some SQL function?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question