Linked Questions

225 votes
6 answers
557k views

I'm trying to list the latest destination (MAX departure time) for each train in a table, for example: Train Dest Time 1 HK 10:00 1 SH 12:00 1 SZ 14:...
Aries's user avatar
  • 2,321
26 votes
2 answers
51k views

I have two tables . 1-> SM_Employee (1) employeeid (2) roleid (3) storeid 2-> SM_SalesRepWorkflow (1) workflowid (2) Salesrepid foreign key to employeeid (3) QuantityAssigned (4) ...
Vijay's user avatar
  • 573
26 votes
2 answers
55k views

I have the following table in an Oracle DB id date quantity 1 2010-01-04 11:00 152 2 2010-01-04 11:00 210 1 2010-01-04 10:45 132 2 2010-01-04 10:45 318 4 ...
Tom's user avatar
  • 1,783
12 votes
5 answers
34k views

I've found some solutions for this problem, however, they don't seem to work with Oracle. I got this: I want a view to present only the informations about the oldest person for each team. So, my ...
user7243231's user avatar
8 votes
4 answers
20k views

I'm new to working with analytic functions. DEPT EMP SALARY ---- ----- ------ 10 MARY 100000 10 JOHN 200000 10 SCOTT 300000 20 BOB 100000 20 BETTY 200000 30 ALAN 100000 30 TOM ...
Travis Heseman's user avatar
10 votes
3 answers
26k views

I am having a hard time doing this without searching the same table at least twice in order to grab the max row, and then grab the value for that row. The table in question is quite big so this is ...
Jeremy's user avatar
  • 5,473
9 votes
1 answer
11k views

I want to get the values of a column based on max of a different column grouped by another column. I have this table: KEY NUM VAL A 1 AB B 1 CD B 2 EF C 2 GH C 3 HI D 1 JK D ...
DRTauli's user avatar
  • 771
5 votes
6 answers
8k views

I'm joining tables. I only want to return one record from the joining table, based on a date field. Here's a simplified fiddle of what I've done so far: http://sqlfiddle.com/#!3/be0cdd/2 My tables: ...
drc15's user avatar
  • 103
1 vote
3 answers
14k views

I've following table: PERSON_ID EFFECTIVE_END_DATE ASSIGNMENT_ID FULL_NAME 33151 2013-08-04 00:00:00.0 33885 Test, C 33151 2013-10-04 00:00:00.0 33885 ...
user avatar
3 votes
2 answers
4k views

ID| tag | version -----+-----+----- 1| A | 10 2| A | 20 3| B | 99 3| C | 30 3| F | 40 desired output: 1 A 10 2 A 20 3 B 99 How can I get the max version of every ID and the ...
Nickpick's user avatar
  • 6,687
-1 votes
4 answers
10k views

So here is a case where one of the column in a table has same values for multiple records but the Date column has incremental values. ID| PAY_CODE| RATE | Date --------------------------------- 1 ...
intruder's user avatar
  • 417
1 vote
2 answers
3k views

Possible Duplicate: Fetch the row which has the Max value for a column I have an audit table of people and the number of shares they own at a particular timestamp. How do I fetch the most recent ...
ThinkCode's user avatar
  • 8,021
0 votes
2 answers
6k views

goal I have a student table. I need to show the details viz. name of the student who has obtained the maximum marks in a test. definition of the tables the following is the code for the definition ...
icyflame's user avatar
  • 5,235
0 votes
3 answers
3k views

I have the table ABC with the following data Id Name Date Execution id -- ---- --------- ------------- 1 AA 09SEP2019 11 1 AA 08SEP2019 22 1 AA 07SEP2019 33 ...
Vic VKh's user avatar
  • 311
-1 votes
2 answers
4k views

Sample table: Hi, can someone pl. help how do I get the least date and corresponding name from the table above? I should get only 3 rows, with first one as Ram and second one as def and third one as ...
Prakash's user avatar
  • 17

15 30 50 per page
1
2 3 4 5
26