Here are the details. We are running Sybase Adaptive Server Enterprise 11.9. We need to migrate to the new version which is Version 12.5. The new version is more "strict" on using ANSI standards. So we need to make some modifications to our code, especially where we are using some joins. In the old version we could use Having with joins now that is not Legal syntax so we need to find a different way. Following are two examples of code. Basically we need to find a different way then the HAVING clause. Thanks for any help you can give me.
EXAMPLE 1:
Select ..........................................
from dbname.dbo.Table1 a, dbname.dbo.Table2 b,
dbname.dbo.Table3 c, dbname.dbo.Table4 d,
dbname.dbo.Table5 e, dbname.dbo.Table5 f,
#TEMPTable6 g, #TEMPTable7 h, #TEMPTable8 i, dbname.dbo.Table9 j
where a.Some_column = c.Some_column
and a.Some_column = i.Some_column
and a.Some_column = b.Some_column
and a.Some_column in (@TEMP_DATA, @TEMP_DATA, @TEMP_DATA,
@TEMP_DATA, @TEMP_DATA, @TEMP_DATA)
and b.Some_column is not null
and b.Some_column = 'I'
and c.Some_column <> "SOME_DATA"
and c.Some_column = e.Some_column
and e.Some_column = f.Some_column
and e.Some_column = f.Some_column
and e.Some_column = g.Some_column
and e.Some_column = h.Some_column
and e.Some_column = i.Some_column
and i.Some_column = j.Some_column
and e.SAME_COLUMN *= d.SAME_COLUMN
GROUP BY e.Some_column, i.Some_column
HAVING e.Some_column = f.Some_column
and e.Some_column = f.Some_column
and e.Some_column = g.Some_column
and e.Some_column = h.Some_column
and e.Some_column = Max(i.Some_column))
and i.Some_column = Max(j.Some_column))
and e.SAME_COLUMN *= d.SAME_COLUMN