Tag Archive for 'cte'

TSQL Challenge #12 Using Date Functions And Recursive CTE, Laurent Schneider Fun Stuff

Add a comment

TSQL Challenge #12

I’m a bit late on this one !
The last submition date for TSQL Challenge #12 was yesterday !
But I had some holidays and the weather was sunny so I spend less time on my computer !
I couldn’t use (nor understand) the arithmetics Pacmann used in the comments of the previous blog entrie.
He managed [...]

TSQL Challenge #11 Using Recursive CTE

Add a comment

Here is my proposal about the TSQL Challenge #11.
Given a product table, and a coupon table, we have to find within one or two coupons which combination gives the best discount, with additional rules :

the discount price can not be less than 70% of the original price
the total amount of the discount can [...]

Is Distinct A Synonym To Order By In MS SQL Server ?

1 Comment

This afternoon, I was chatting with Antoine Gémis about T-SQL, and this subject came on the table.
He was asking if, in my opinion, using both a distinct and an order by in the same statement would make the query worst due to the fact that distinct is already performing a sort on his own.
Working mostly [...]

Another TSQL Challenge : How To Handle Breaks !

Add a comment

Beyondrelational published their new TSQL Challenge #9, and as usual Antoine Gémis translated it in french.
They have taken redefined the goal about those challenges which I think is a very nice move.
The goal of TSQL Challenges is to help people enhance their SET based query writing skills.
Most of the times, a SET based query performs [...]

Challenges !!!

1 Comment

TSQL Challenge
 
Last month I answered about a SQL Challenge from Antoine Gemis (french here). My solution wasn't very nice, I used a flaw in the data to provide an easy query with basic outer joining.
As the only challenger, I won it !
Antoine's told be about some regular TSQL Challenges (meaning SQL Server) but i didn't [...]