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 8186487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:13:13+00:00 2026-06-07T02:13:13+00:00

I would like to create a view from a table like this: Configuration |

  • 0

I would like to create a view from a table like this:

Configuration |   Size  | Runtime    
0             |    10   |  32.5    
1             |    10   |  30.8   
2             |    10   |  40.1    
0             |    20   |  61.0   
1             |    20   |  65.3   
2             |    20   |  56.8

Where configuration number 0 is special (it is the default configuration) and it is
present in every group of “Size” values.
My goal is to create a view like this:

Configuration |   Size  | Speedup
0             |    10   |  1.0
1             |    10   |  1.05
2             |    10   |  0.81
0             |    20   |  1.0
1             |    20   |  0.93
2             |    20   |  1.07

For each group of rows with the same size I would like to find the default configuration (identified by number 0) and then compute the ratio between the runtime of the considered row and the default runtime.

This can be splitted in two queries:

  1. look for the default runtime for the given “Size”
  2. perform the ratio between the runtime and the default.

The problem is that in query number 1 (that should be a subquery in the select statement of query 2) I don’t know which “Size” I am currently considering.
I hope you understand what I mean.

I there a way around this problem ?

  • 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-07T02:13:15+00:00Added an answer on June 7, 2026 at 2:13 am

    Another approach you could use is a subselect:

    CREATE VIEW yourview AS
    SELECT
        Configuration,
        Size,
        (SELECT Runtime
         FROM yourtable AS T2
         WHERE T1.Size = T2.Size
         AND T2.Configuration = 0) / Runtime AS SpeedUp
    FROM yourtable AS T1
    

    See it working online: sqlfiddle

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

Sidebar

Related Questions

I would like to create a view from the following table. This table contains
So I am creating a table from a view right now like this: CREATE
I have a view like this: CREATE VIEW MyView AS SELECT Column FROM Table
I would like to create a view where this subview will be in repeated
I would like to create table which can display data from database into JSF
I have a temporary table and I would like to create a temporary view
I would like to create this shape using just css. I am pretty sure
I would like to create a view that has a single column. If my
I have a table with a column called YEAR. I would like to create
i would like create a array of structure which have a dynamic array :

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.