Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9148365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:15:06+00:00 2026-06-17T11:15:06+00:00

Raw data as result of a create view data as select […] statement: projectId

  • 0

Raw data as result of a create view "data" as select [...] statement:

projectId   resourceId  num

1052785922  318153743   10
1052785922  318153743   20
1052785922  318153743   30

1052785936  -2097765361 20
1052785936  318153743   10
1052785936  528513104   30

1052786014  -2097765361 20
1052786014  318153743   10
1052786014  528513104   30

1052786021  -2097765361 20
1052786021  318153743   10
1052786021  528513104   30

1052786099  -2097765361 20
1052786099  318153743   10

I try to filter above data to only get those rows with max(num) per projectId.

estimated results:

projectId   resourceId  num

1052785922  318153743   30
1052785936  528513104   30
1052786014  528513104   30
1052786021  528513104   30
1052786099  -2097765361 20

I know about the possibilities to self left join on num = max(num) , window-function like max(num) over ( partition by projectId ) or CTE, but I wonder if there’s any other possibility to just select those with highest value of num.

Background:
Above data is only a spot of a large view, which is relatively complex. Since it is a view, I don’t think about CTEs or anything this way. The data provided in the view is to feed a planning-app and runtime is quite important. I don’t wan’t to struggle, ending in performance-expensive view-selects.

The above “raw data” is the result of a view combining data from dozens of tables. I’m looking for a way to filter for the grouped max-values in the creation-statement of this view directly at one shot, without having to put an extra layer or view in between!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T11:15:07+00:00Added an answer on June 17, 2026 at 11:15 am

    I’ve done it creating the view as select from a UDF to preprocess the data the way Mahmoud supposed to do. UDF allows me to use temp-tables instead of CTE which can be executed multiple times eventually.

    Thanks to all for hints!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a new Image from raw data in unsigned char
I'm getting raw data from both the keyboard and the mouse - the keyboard
I've got raw data streams from image files, like: vector<char> rawData(fileSize); ifstream inFile(image.jpg); inFile.read(&rawData[0]);
Here's a chunk of the raw data: 00000000 54 6f 70 69 63 20
I have a sheet full of some raw data, about 20,000 rows and 50
Behind the tables and tables of raw data, how does Wolfram Alpha work? I
I'm trying to build render the raw data from a Quake 3 .map file
How can I effectively trace the raw data sent to my socket server listening
I just want to intercept raw data (hex)--headers and all--sent to a port, and
Is there a way to restore an Oracle 11g instance from raw data files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.