Sunday, April 27, 2014

Database Query

For this type of question it is often a good idea to post:


1) CREATE TABLE statements for your tables, preferably simplified for the

pertinent parts of the problem.


2) INSERT statements with sample data.


3) The desired result given the sample.


4) A short description of the business rules that explains why you want that result.


5) Which version of SQL Server you are using.


This makes it simple to copy and paste into a query window to develop a tested solution.


With the information you have posted, I could at best post wild guesses for that you are looking for.





Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

No comments:

Post a Comment