GROUPING SETS equivalent | for SQL Server 2005 and below

Sometime back I discussed about [GROUPING SETS] in my previous post and today one reader of this blog asked me how we can create the same result-set without using… 225 more words

SQL Server 2005

SQL #57–A one-liner query with PARTITION BY

What can be done in SAS must be possible in SQL

A friend of mine is a data professional in marketing data analysis with expertise in SAS and pretty good working knowledge of SQL. 879 more words

SQL Challenge

Do You Really Understand SQL's GROUP BY and HAVING clauses?

There are some things in SQL that we simply take for granted without thinking about them properly.

One of these things are the GROUP BY… 1,322 more words


Filter on the display method using context method

Example: InventSerial table

1. Add a display method for product number on the InventSerial table

display Name ItemDesc()
Name name;

name = InventTable::find(this.itemId).itemName();
return name;

346 more words
Ax 2012

Find duplicates in SQL

If you have a primary key setup for the table, there can be no rows that have duplicate ID (Primary key column). Therefore you can’t find duplicates based on that column. 56 more words


Simplifies SQL-style Computations – In-group Computation

During developing the database applications, we often need to perform computations on the grouped data in each group. For example, list the names of the students who have published papers in each of the past three years; make statistics of the employees who have taken part in all previous training; select the top three days when each client gets the highest scores in a golf game; and the like. 614 more words