Just nu kan jag bara tänka på en undervald version:
SELECT type, amount
FROM table AS t
WHERE dat = (
SELECT MAX(dat)
FROM table
WHERE type=t.type
AND dat <= '2011-03-01'
)
Just nu kan jag bara tänka på en undervald version:
SELECT type, amount
FROM table AS t
WHERE dat = (
SELECT MAX(dat)
FROM table
WHERE type=t.type
AND dat <= '2011-03-01'
)