wil
wil

Reputation: 1

How can i use a min() funct in this sql query?

UPDATE
            MRT

SET 
             Date = MR.Date

FROM
             MRT
             JOIN MR on MR.SKU = MRT.SKU

HERE Is where i would like to do an order by min(mr.Date)

All I get is an incorrect Syntax error.

I have to set the date = the smallest mr.date

Upvotes: 0

Views: 88

Answers (1)

a'r
a'r

Reputation: 36999

UPDATE MRT SET Date = (SELECT min(Date) FROM MR WHERE MR.SKU = MRT.SKU);

Upvotes: 3

Related Questions