Git Product home page Git Product logo

Comments (6)

ahmad-moussawi avatar ahmad-moussawi commented on August 19, 2024

Thanks, could you give me please an example of what you want to achieve ?

from querybuilder.

generik0 avatar generik0 commented on August 19, 2024

Hi

PIVOT:
https://technet.microsoft.com/en-us/library/ms177410(v=sql.105).aspx

I can add the pivot query to a compiled .SQL but it would be nicer as a function.

Pivot makes rows to columns.

-- Pivot table with one row and five columns
SELECT 'AverageCost' AS Cost_Sorted_By_Production_Days,
[0], [1], [2], [3], [4]
FROM
(SELECT DaysToManufacture, StandardCost
FROM Production.Product) AS SourceTable
PIVOT
(
AVG(StandardCost)
FOR DaysToManufacture IN ([0], [1], [2], [3], [4])
) AS PivotTable;

from querybuilder.

ceastwood avatar ceastwood commented on August 19, 2024

@ahmad-moussawi we should mention that if the pivoting is a business as usual scenario, that the user create a materialized view function in code as it would likely perform better; as for pivot in general, I need to look at the differences in engines but I'm guessing compiler support is necessary.

from querybuilder.

generik0 avatar generik0 commented on August 19, 2024

@ahmad-moussawi, @ceastwood

The whole point of the pivot table is that rows can become columns dynamically.

from querybuilder.

ahmad-moussawi avatar ahmad-moussawi commented on August 19, 2024

Yes, actually I did a quick research, it seems that this feature is supported only on SqlServer, and it's hard to emulate it's functionality for others compilers, so I think the best thing is to put it on the back log for now, maybe we provide provider-specific extensions later that support these kind of functionalities

from querybuilder.

generik0 avatar generik0 commented on August 19, 2024

Ok :-)

from querybuilder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.