I want to create a View with a lenghty query like :
CREATE VIEW doubleV
AS
SELECT * FROM X1 as R
WHERE [Ext] IN
(
SELECT [Ext] FROM X1 as RR
WHERE RR.cliID=R.cliID
AND Soc='j'
GROUP BY [Ext]
HAVING COUNT(*) > 1
)
But when i Select all elements from this VIEW, Sql server just execute the query inside the view, which takes much time.
Is it possible to execute the query at the VIEW CREATION ?
Does anything would allow me to make a temporary table with a query result ?