Forum Replies Created

Viewing 15 posts - 9,796 through 9,810 (of 10,144 total)

  • RE: Return the most frequent value

    Hey Chris, if you still have your test environment handy, would you mind comparing the SQL2k version against the 2k5 versions?

    Cheers

    ChrisM

    DROP TABLE #Customers

    CREATE TABLE #Customers (AccountNum int, DM_Source_Id int, Address...

  • RE: Return the most frequent value

    Top work, Jeff! It looks so much nicer in SQL2k5.

  • RE: Unmatched Rows in Tables

    This will provide you with rows which are in Table_A but do not have an exact match in Table_B.

    SELECT a.*

    FROM Table_A a

    LEFT JOIN Table_B b

    ON b.[Id] =...

  • RE: Return the most frequent value

    I think this works but gosh it's pretty horrible...

    DROP TABLE #Customers

    CREATE TABLE #Customers (AccountNum int, DM_Source_Id int, Address varchar(60))

    INSERT INTO #Customers (AccountNum, DM_Source_Id, Address)

    SELECT 46786, 1, 'Mcmullen Road/N /n/nDarlington/nDurham' UNION...

  • RE: Unmatched Rows in Tables

    Hi Shenijoy

    In your first post, you show three rows for each table. Each of the three rows from Table_A has the same Id, "123".

    Lets say you want to compare the...

  • RE: Expiry Date

    b_boy (7/21/2008)


    Hello All

    I kinda found a way which is KISS (Keep It Simple and Simple), i used in my select query:

    WHERE[ExpiryDate] BETWEEN getdate() AND getdate() +30

    b_boy, KISS is an...

  • RE: Expiry Date

    rbarryyoung (7/21/2008)


    b_boy (7/21/2008)


    I am trying to write a query, that will retrieve records of customers that are about to expire within two week of expiry.

    ...

    WHERET_Customers.ExpiryDate = (GETDATE() + 7)

    Did you...

  • RE: Expiry Date

    Don't mind at all but like everybody else here I'm doing real-time work simultaneously so responses may not be immediate.

    Back to the beginning...

    What if there are no customers about to...

  • RE: Expiry Date

    b_boy

    What if there are no customers about to expire? You will get no data returned from your query and think there's something wrong with your coding.

    Often eyeballing the data...

  • RE: HELP! IF table data in both tables....

    Hi Greg

    I'd test these for performance, if necessary, by scaling the rowcounts in the test tables up to a point where the time taken for each query to run is...

  • RE: HELP! IF table data in both tables....

    Greg Snidow (7/18/2008)


    Chris Morris (7/18/2008)


    ON b.keyid LIKE a.keyid + '%'

    Chris, that looks like a nifty little trick, what exactly is the '%' doing?

    Hi Greg

    It's a wildcard character.

    b.keyid LIKE a.keyid...

  • RE: Need to remove duplicate records and get distinct values

    I've got three pennies in my pocket. I've counted them more than ten times now, facing different directions, but each time I get the same result. Three pennies.

    I'm baffled.

  • RE: HELP! IF table data in both tables....

    CREATE TABLE #TableA (KeyID varchar(20))

    CREATE TABLE #TableB (KeyID varchar(20))

    INSERT INTO #TableA

    SELECT '11111.001' UNION ALL

    SELECT '11111.002' UNION ALL

    SELECT '22222.001.01' UNION ALL

    SELECT '120394.001' -- ADDED DATA

    INSERT INTO #TableB

    SELECT '11111.001.05.05' UNION ALL...

  • RE: Need to remove duplicate records and get distinct values

    Of course!

    update #t1

    set #t1.Name = T.Name

    from #t1 inner join T

    on #t1.ID =T.ID

    In order for it to be "legal", TableA must also be in the FROM clause or the huge performance...

  • RE: Need to remove duplicate records and get distinct values

    karthikeyan (7/17/2008)


    In order for it to be "legal", TableA must also be in the FROM clause or the huge performance problem could take place. General rule to follow on...

Viewing 15 posts - 9,796 through 9,810 (of 10,144 total)