I always worked with MySQL but we currently have a customer with a MSSQL database and it give me some headaches... I managed to convert almost all my queries to mssql, but i'm currently stock with this one.
I try to do some paging with mssql:
WITH news_PAGING AS
(
SELECT ROW_NUMBER()
OVER(ORDER BY news_index.display_order ASC) AS RowNum,
news_index.*,
news_content.*
FROM
news_index
LEFT JOIN
news_content
ON (news_content.news_id = news_index.news_id)
WHERE
news_content.lang = 'en'
)
SELECT *
FROM news_PAGING
WHERE RowNum BETWEEN (1 - 1) * 10 + 1
AND 1 * 10
ORDER BY display_order ASC;
And I get this error:
Invalid object name 'news_index'.
I tried to search for an answer with google but it seem to be a general error for many problems... can anyone help me? It would be very appreciated 🙂