Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to perform calculation with the previous record
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00537434
Message ID:
00538249
Views:
12
>But I haven't of JOIN. I think that I can do something like:
>INNER JOIN thetable b ON b.date = (select min(date) ... where c.date > a.date )
>
>Can this be good?

this might be you're only option but I think you want a MAX() and not MIN(). You want the maximum date that is less than the date in the outer query.

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform