In Oracle / SQL Server I can use the WITH keyword to define a transient table for use in views:
WITH a AS (SELECT something_horrible FROM somewhere_horrible)
SELECT * FROM a
Very handy when the ‘table’ a may be used many times in the query. I think there are performance gains when the SELECT for a is convoluted (I think it’s usually only executed once).
Is there an equivalent in Sybase?
(NB I know there are temp tables, but I am trying to write VIEWs, hence no syntax to create / use the temp table)
Thanks in advance
Ryan
AFAIK Sybase supports CTEs. So you can use both WITH and WITH RECURSIVE keywords