I am trying to write a query (SQL Server 2005) that always returns five records even if there is only e.g. 2 matching records in the database. Then the other 3 should be null or blank. Any ideas?
This is the ANSI SQL forum, and SQL Server 2005 has lots of things that can help you that will not be covered by ANSI SQL, or that will be done differently.
But in any case look at the INNER/OUT JOINS as one of them will do what you want. And it is clear in the SQL Server books online what they do
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.