Search
 
SCRIPT & CODE EXAMPLE
 

SQL

jooq finding lastest value in table

// Assuming these static imports
import static org.jooq.impl.DSL.*;
import static com.example.generated.Tables.*;

Student t = STUDENT.as("t");
Field<Date> maxDate = max(STUDENT.EVENT_DATE).as("MaxDate");
Table<?> tm = table(select(STUDENT.ID, maxDate)
                   .from(STUDENT)
                   .groupBy(STUDENT.ID)).as("tm");

ctx.select()
   .from(t)
   .join(tm)
   .on(t.ID.eq(tm.field(STUDENT.ID)))
   .and(t.EVENT_DATE.eq(tm.field(maxDate)))
   .fetch();
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to lock and hide a cursor unity 
Csharp :: c# get desktop path 
Csharp :: but dotnet-ef does not exist. 
Csharp :: count number of enum values C# 
Csharp :: lockstate untiy 
Csharp :: unity create random string 
Csharp :: convert system.byte a string c# 
Csharp :: unity how to convert mouse screen position to world position 
Csharp :: aspx textarea 
Csharp :: unity right click on gameobject 
Csharp :: c# async sleep 
Csharp :: unity how to convert to byte 
Csharp :: c# sleep 1 second 
Csharp :: unity check if number is multiple of x 
Csharp :: how to change image color unity 
Csharp :: blazor get current url 
Csharp :: url()- full() laravel 
Csharp :: get application path c# 
Csharp :: how to move a object in unity c# 
Csharp :: asp.net core get request ip address 
Csharp :: c# random boolean 
Csharp :: unity textmesh pro 
Csharp :: string to enum c# 
Csharp :: Schema::defultString larvel 
Csharp :: get datacontext of parent wpf 
Csharp :: move file c# 
Csharp :: c# format string with 2 decimals 
Csharp :: c# application hangs while running 
Csharp :: c# download file 
Csharp :: get all devices in game unity 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =