ms access - Find related "ordered pairs" in SQL -


Assume that I have a table format that looks like this:

 Element Force - Frames

I would like to write a query that finds the maximum station for a given frame and output case (The result is grouped by frame and output case) Returns ordered (and ultimately V2, V3, T, M2 and M3), which is connected to the maximum station Will happen. The desired questions are shown below:

Element Force - Frames, Required Queries < P> I can not figure this out for my life. I have posted a copy of access database on my Google Drive:

  select X *, From TP (frame select frame, output cakes, max (station) output by TBL group, by maximum frame x) xframe = t.frame and x.outputcase = t.outputcase and x.max_station = X.frame, x. Order t.station by outputcase;   

Just to avoid confusion, as a note, w / that second column, the T table is the nickname, P is the name of the column.

We have assigned the nickname of X, we get the maximum (station) for each unique combination of the frame (frame, output), whatever you want, but the problem does not stop there, you also want to call the column The reason for this is that the selection can not be made in the same question, because you had to group it, and you do not want maximum (stations) for each combination of (frame, output, p). You want the maximum (station) for each combination of (frame, output).

Because we could not find the column in the first stage, we would have to get back to the original table using the value (which I have assigned to a nickname, max_station), and in clear conditions of the frame and output So we join the original table on those three things, 2 of which are the fields on the actual table, one of which is counted in the subquery (max_station).

Because we are back to the original table, then we can choose column P from the original table.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -