Mysql
 sql >> Database >  >> RDS >> Mysql

Data e ora più vicine in MySQL

Se intendi farlo per ogni riga, prova questo:

SELECT a1.id,
    (SELECT MIN(a2.Auction_StartDate) 
     FROM Auctions a2 
     WHERE a2.Auction_StartDate > a1.Auction_StartDate) AS nextStartDate
FROM Auctions a1