Harish, MAX(A.ALPHAID) sets, all the BETAID's to the highest value in the lookup table, so if I have a table with 1/3 'First', 1/3 'Second' and 1/3 'Third, it sets all the BETAIDs to '3', which is incorrect. I've also tried group by, having count and distinct and none of these update the rows one at a time like the inner join syntax does.
Main Topics
Browse All Topics





by: mgh_mgharishPosted on 2006-01-29 at 16:22:42ID: 15820108
Hi servantis, try this:
UPDATE BETA
SET BETAID = (SELECT MAX(A.ALPHAID) FROM ALPHA A, BETA B
WHERE B.BETAID = A.ALPHADESC);
---
Harish