2 Chronicles 22:1

And the inhabitants of Jerusalem made Ahaziah his youngest son king in his stead: for the band of men that came with the Arabians to the camp had slain all the eldest. So Ahaziah the son of Jehoram king of Judah reigned.

The inhabitants of Jerusalem set Ahaziah on the throne of Judah in succession to Jehoram, so that Ahaziah's reign follows Jehoram's and does not precede it. The Jehoram named as father of the new king is Jehoshaphat's son, the king of Judah, not Jehoram son of Ahab. Jehoram began to reign jointly with his father Jehoshaphat in 796 B.C., Jehoshaphat died two years later, Jehoram's eight-year reign was reckoned from the beginning of that joint rule, and Ahaziah began to reign in 789 B.C. Ahaziah stands in the line of the wicked rulers of the kingdom of Judah.

Read together with the figures in 2 Chronicles 21:20, the account creates an apparent discrepancy in ages that makes Ahaziah seem older than his father, and the discrepancy is accounted for as a copying error in the numbers.