Forum Replies Created

Viewing 15 posts - 1 through 15 (of 66 total)

  • RE: Select And Count Consecutive Numbers

    Ok, I was wrong.

    Jan

  • RE: Select And Count Consecutive Numbers

    Jeff and all others,

    I have helped a lot of people here, but this game is becoming too anoying. Why should I continue this child play?

    1) Would you be so kind...

  • RE: Select And Count Consecutive Numbers

    Hi Jeff,

    Sure my code works! I never post anything without testing it first. It is of course possible that we misunderstand what is needed, but even that is not the...

  • RE: Is it possible to do.....Query help

    Yes, I also changed the quantity to a constant 1 in the query, but I forgot to color it....

    SELECT     NBillingF.OrderNumber, NBillingF.Customerorderreference,

      AccountOwner.company, NewCARORDER.Orderaddressline5,                     

      customers.company AS Expr1, NewCARORDER.Orderaddressname,

      Product.[Manufacturer Part Number], ...

  • RE: Is it possible to do.....Query help

    SELECT     NBillingF.OrderNumber, NBillingF.Customerorderreference,

      AccountOwner.company, NewCARORDER.Orderaddressline5,                     

      customers.company AS Expr1, NewCARORDER.Orderaddressname,

      Product.[Manufacturer Part Number],  Product.[Product Description],

      1, NewCARORDER.SystemOrderDate,

      NBillingF.DateInvoiced, NBillingF.Unitprice,              NBillingF.InvoicedValueBase

    FROM         NBillingF INNER JOIN AccountOwner

        ON (NBillingF.Customer = AccountOwner.account)

       INNER JOIN NewCARORDER...

  • RE: Inserted Identities

    In that case, the identity will just increment as it should. Mind that there is no specific order in Table2 and I am not sure that an ORDER BY will...

  • RE: Inserted Identities

    Hossein,

    The insert will only be allowed if this setting is set:

    SET IDENTITY_INSERT table1 ON

    and with explicit columns:

    INSERT INTO table1 (col1, col2)

    SELECT col1, col2 FROM table2

    GO

    SET IDENTITY_INSERT OFF

    In this scenario the...

  • RE: Date vs Int

    Hi Tymberwyld,

    An int is 4 bytes and a datetime is 8 bytes. The smaller your datatype, the more you can get on a page and the better use of indexes...

  • RE: SELECT/COUNT CONSECUTIVE NUMBERS

    I replied on:

    http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=367397

    I think most users would agree that it is annoying to post the same question in several threads. This is not helpful for other people who are...

  • RE: Select And Count Consecutive Numbers

    David,

    My solution did not show a duplicate. I just added a second employee because you were mentioning that you needed a group by employeeId; but in your test data there...

  • RE: SELECT/COUNT CONSECUTIVE NUMBERS

    I have already posted the result in http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=367397

    Maybe it is better not to post the same question in 2 threads.

    Jan

  • RE: Select And Count Consecutive Numbers

    use

    tempdb;

    CREATE

    TABLE test( EmployeeId int, Freight decimal

  • RE: Is it possible to do.....Query help

    Vandy,

    Cursors incur an overhead and temporary tables involve always io in tempdb (also an 'in-memory table' which is actually a misnomer). Here is a solution that just uses simple tsql:

    --...

  • RE: Query??

    Would this be what you mean?

    SELECTCASE WHEN(COUNT(CASE WHEN Diagnosis = 'Apple' THEN 1 END) = 1) THEN 'yes' ELSE 'no' END AS [Apple],

    CASE WHEN(COUNT(CASE WHEN Diagnosis = 'Banana' THEN 1...

  • RE: Select And Count Consecutive Numbers

    David,

    Is it always going to be incrementals steps of 0.01?

    The DISTICT was necessary because there where 2 values of 4.99, namely 16 and 17.

    I hope this is what you needed?

    WITH...

Viewing 15 posts - 1 through 15 (of 66 total)