Forum Replies Created

Viewing 10 posts - 16 through 25 (of 25 total)

  • RE: Sub Query

    Raghavendra Mudugal (7/25/2014)


    from my angle it looks like... depending on the query how it is constructed, it changes its behaviour of processing.

    Maybe this is why I wrote "a correct answer",...

  • RE: Sub Query

    robertjtjones (7/25/2014)


    Agree with the above posts

    I assume that the point is supposed to be that the inner query result affects the rows returned in the outer query - but this...

  • RE: Sub Query

    Certainly I missed something, but what about http://technet.microsoft.com/en-us/library/ms187638%28v=sql.105%29.aspx ?

    In queries that include a correlated subquery (also known as a repeating subquery), the subquery depends on the outer query for...

  • RE: Trying to find the difference between two sub-totals (sales - credits)

    Assiming that TotalCredits is the result of second part of query, I think this will work. (Not tested)

    Select T0.ItemCode, T0.TotalSales - T1.TotalCredits

    from

    (select ItemCode, sum(LineTotal) as TotalSales

    from Inv1

    group by ItemCode

    ) T0

    join...

  • RE: What is (Null='Hello') in Sql Server

    mikesyd (3/26/2014)


    I get the explanation for why 5 does not show up. Is that the same reason 2 also doesn't show up? My guess was 2, 4, and...

  • RE: How To Script Default Value

    There is not any difference. Simple parentheses may help for readlibility. Double parentheses, I don't see :ermm:

    The only difference I read about parentheses in DEFAULT close is that niladic functions...

  • RE: Conditional Default value for a column

    No. Just try it !

    You'll get an error message :

    Msg 128, Level 15, State 1, Line 3

    The name 'cc' is not permitted in this context. Only constants, expressions, or...

  • RE: Problem with update syntax

    Why not simply

    UPDATE DIM.DocControlProfile

    SET DocType = (select( SUBSTRING(CurrDocNumber,1,1)

    FROM STG.Staging

    ...

  • RE: Decimal result not getting properly.

    SELECT ROUND(CAST (22.0/30 AS decimal (6,2)),2);

    1/ Sql considers 22 and 30 as integers, and so it performs an integer division. So the result is 0. Writing 22.0 force Sql to...

  • RE: Compare calculated value in where clause

    You can't use column aliases in WHERE clause. uses the plain expression to compare :

    Select store_Name, latitude, longitude,

    SQRT(POWER(Latitude - @Latitude, 2) + POWER(Longitude - @Longitude, 2)) as Distance

    From...

Viewing 10 posts - 16 through 25 (of 25 total)