Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fixed number of records

Status
Not open for further replies.

marcusmco

IS-IT--Management
Oct 9, 2006
30
AU
Hello,

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?

Regards,
Marcus
 
yes.

post in forum183

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

Regards

Frederico Fonseca
SysSoft Integrated Ltd

FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top