Tag Archives: Queries

The Equivalent of T-SQL’s SELECT TOP N in Oracle PL/SQL

So you have been coding away T-SQL queries for a while now and know that by using the TOP keyword you can select the first what’s-the-number rows of your result set. Suddenly you find yourself in a familiar SQL environment, … Read More »»»

Posted in Oracle PL/SQL | Tagged , , , , , , , , | Leave a comment

How to Calculate a Median in T-SQL

Expectantly, you’d assume that Microsoft had built in a function to calculate a median of a set of values. Expect less! Or, rather none. There is no built-in function in T-SQL to calculate a median. I do not know the … Read More »»»

Posted in MSSQL | Tagged , , , , , , , | Leave a comment

How to Get Distinct Values From a LINQ Query

Ever wondered how to get a distinct value set from a LINQ query? Maybe you got that query from a database: var q = dataSet.Tables[0].AsEnumerable(); Or maybe it’s a query on a LINQ query: var q = from oq in … Read More »»»

Posted in Basics | Tagged , , , , , , | Leave a comment