def sql to old sql