SELECT test.valdouble as measuredPower,  test.valint1              as csLinkId
FROM tbl1 test,
	(SELECT MAX(test.valdate) as maxDate, test.valint1
	FROM tbl1 test
	group by test.valint1) as last_entry
WHERE test.valint1 = last_entry.valint1
and test.valdate = last_entry.maxDate
and test.valint1 in  (
3289475,
3289496,
3289562,
3289593,
3289594,
3289595,
3289626,
3289642,
3289658,
3289739,
3289750,
3289761,
3289762,
3289763,
3289774,
3289780,
3289951,
3289957,
3289988,
3290034,
1231562 );
