× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




Does anyone know if it is possible to perform a SQL OVER(PARTITION BY...) as a subselect? I want to only perform the OVER(PARTITION BY for the row that is being selected in a SELECT statement. I would rather not execute a OVER(PARTITION BY over the whole second table, since it causes 166,000,000+ rows to be partitioned that don't need to be.

I am selecting rows from a main table, and using a column in that table to narrow down the PARTITION BY to only select rows in the second table that match what is selected from the main table. I need the partition by as a further criteria on the main table select so I only include rows from the main where a specific selection exists in the second table, and that condition needs to be set up as a partition by.

For example:

Select a, b, c, d from tablea where
A = 100 and
B = 2 and
C in (select * from (OVER(PARTION BY SYNTAX built only over rows in tableb that have a value in a column ZZ that equals the value in C)))

We are on 7.1

Thank you,

Doug


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.