Forum Replies Created

Viewing 15 posts - 856 through 870 (of 4,085 total)

  • RE: What are some really dumb things you could write in a SQL Query

    Here's a new one.


    SELECT <primary key>, <other fields>
    FROM Table_Stage

    INTERSECT

    SELECT <primary key>, <other fields> /*  all fields from Table_Prod  */
    FROM...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Today's Random Word!

    Ray K - Wednesday, October 10, 2018 12:09 PM

    DesNorton - Wednesday, October 10, 2018 6:59 AM

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Showing all records that appear more than once

    ScottPletcher - Wednesday, October 10, 2018 11:13 AM


    SELECT tn.*
    FROM (
        SELECT NUMBER
        FROM dbo.table_name
        GROUP BY NUMBER
     ...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: What are some really dumb things you could write in a SQL Query

    Also using the same expression in both the PARTITION BY and ORDER BY clauses of an OVER() clause.

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: What are some really dumb things you could write in a SQL Query

    NOLOCK

    Using DISTINCT with UNION or GROUP BY.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Importing from XML to SQL 2014

    The problem appears to be here:
        SQLCMD.CommandText = "IF OBJECT_ID(N'dbo.WomenStartListDay1', N'U')

    IF requires a conditional expression and OBJECT_ID(...) does...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: date convert function - error

    Furthermore, GETDATE() returns DATETIME, so converting from DATETIME to DATETIME is an identity operation.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Today's Random Word!

    jasona.work - Wednesday, October 3, 2018 2:03 PM

    TomThomson - Wednesday, October 3, 2018 7:25 AM

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Query Performance Improvement

    thenewbee - Wednesday, October 3, 2018 11:55 AM

    Hi Drew,Can you advise what changes have to be made to improve performance Kind Regards...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Query Performance Improvement

    This query is too simple to improve the performance on.  You have none of the major factors that contribute to poor performance, so there is no way to reduce or...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: I need help with SQL queries

    If you are using a view, the problem could be in your view. We would also need the view definition.

    You still haven't supplied the query plan.  We really need...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: I need help with SQL queries

    below86 - Tuesday, October 2, 2018 1:17 PM

    If I know for sure the date field does NOT carry any time values then...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: I need help with SQL queries

    rjp123 - Tuesday, October 2, 2018 2:04 PM

    Thank you for your help,
    I have a scenario where I have millons of rows...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Query: Get Top 3 Records for multiple Field categories

    What have you tried?  HINT: ROW_NUMBER() is probably the simplest approach.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: I need help with SQL queries

    below86 - Tuesday, October 2, 2018 12:33 PM

    Just added a few tweaks:
    DECLARE @StartDate DATE;
    DECLARE @EndDate DATE;
    DECLARE @PrevYearStart DATE;
    DECLARE @PrevYTDEnd DATE;
    DECLARE...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 856 through 870 (of 4,085 total)