Forum Replies Created

Viewing 13 posts - 1 through 13 (of 13 total)

  • RE: Conditional where

    Seems like a case for the APPLY operator!

  • RE: select query

    Sorry, my previous post included some mistakes.

    here is the corrected code:

    SELECT CASE

    WHEN @date1Max >= @date2Max AND @date1Max >= @date3Max THEN @date1Max

    WHEN @date2Max >= @date1Max AND @date2Max >= @date3Max...

  • RE: select query

    Or like this?

    --select the grandmax of the max of three columns

    DECLARE @date1Max AS datetime = (SELECT MAX([orderdate])

    FROM [Sales].[OrderValues]);

    DECLARE @date2Max AS datetime = (SELECT MAX([requireddate])

    FROM [Sales].[OrderValues]);

    DECLARE @date3Max AS datetime...

  • RE: Need a 2nd opinion on a query

    Well said! I just try to keep it. Simple.

  • RE: Need a 2nd opinion on a query

    That's correct but at the WHERE Clause there is just one result set to filter, the result of the join, no need to filter on both tables.

  • RE: select query

    I know but someone posted a reply and I just replied just in case.

    Thanks

    oj

  • RE: select query

    the database TSQL2012 used in the following script can be downloaded at:

    http://tsql.solidq.com/books/tk70461/

    USE TSQL2012;

    --select the grandmax of the max of three columns

    DECLARE @date1Max AS datetime = (SELECT MAX([orderdate])

    FROM [Sales].[OrderValues]);

    DECLARE @date2Max...

  • RE: Need a 2nd opinion on a query

    Could it be that what he is trying to accomplish is the following?

    Select count(*)

    from tblevent a inner join tblevent b on

    a.omsid = b.omsid

    where Recordtype in( 'promo', 'event')

  • RE: select query

    Erroneous posting, sorry!

  • RE: Core T-SQL

    I am impressed, such wisdom!

  • RE: Core T-SQL

    This is a great idea, judging by the debate that it has generated. May I suggest another topic that could generate some controversial debate also?

    I think that...

  • RE: Core T-SQL

    This doesn't sound unreasonable either but, want to ask you is, what should one add to one's skill set to become an expert?

  • RE: Core T-SQL

    I think that a basic level of proficiency should include implementing structured and unstructured error handling.

    About the apply and the windowing functions, or OVER CLAUSES as some developers call them,...

Viewing 13 posts - 1 through 13 (of 13 total)