Forum Replies Created

Viewing 15 posts - 1,636 through 1,650 (of 2,452 total)

  • RE: Order of joins - Which one is better?

    care to share your table scripts / indexes / sample data scripts that demonstrates your issue?

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Newbie Question

    you seem to be making several postings to very old threads......????

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Counting duplicates

    this looks like MySQL code ??

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Best way to find certain records.

    Jeff Moden (5/18/2013)


    The key is to not put columns into functions so that indexes can actually use them as part of a seek.

    Hi Jeff...appreciate you comment.

    however been playing around...always dangerous...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Best way to find certain records.

    ok..try this...far from elegant, and performance may be poor dependent upon number of rows and indexes

    hopefully some else will chime in with a better idea.....

    SELECT DISTINCT ClientId

    FROM...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Best way to find certain records.

    New Person (5/18/2013)


    I am very sorry. You are right . Client Id 1 qualifies all the criteria.

    so can I assume ClientId 3 qualifies as well?

    SELECT ClientId, ActivityId, CreateDate,...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Best way to find certain records.

    why doesn't ClientId "1" qualify?

    SELECT ClientId, ActivityId, CreateDate, DATEDIFF(d, CreateDate, GETDATE()) AS datediff

    FROM TestPurgeClient

    WHERE (ClientId = 1)

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Best way to find certain records.

    can we start again with a bigger data set that demonstrates all your possibilities and the expected outcome.

    sorry...but i'm obviously not thinking clearly 😛

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Best way to find certain records.

    New Person (5/18/2013)


    Thank you very much for your kind response. For this case it is working fine. But in this SQL activity ID is not taken into consideration at all...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Format the Amount

    normally formatting is better left to the front end app to perform.

    sometimes however this isn't always poss or desired.....

    so in this case, how does your client want the following displayed?

    -10,000,000

    1

    10

    100

    1,000

    10,000

    100,000

    1,000,000

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Best way to find certain records.

    as a start...try this

    SELECT ClientId

    FROM TestPurgeClient

    GROUP BY ClientId

    HAVING (SUM(CASE WHEN DATEDIFF(d, CreateDate, GETDATE()) > 90 THEN 1 ELSE 0 END) =...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Using the Generate Script

    AndrewSQLDBA (5/14/2013)


    I have not been able to every find that SSMS will do that. I was hoping that someone had found a way.

    I have the SSMS Tools. So how would...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Using the Generate Script

    http://www.ssmstoolspack.com/Licensing

    take a look above...still free for 2008.

    don't think that SSMS will do what you want...but be very pleased to be proved wrong .

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Query to find certain data

    as a guide

    SELECT COUNT(employee) AS All_cnt,

    sum(case when hiredate = '1995' then 1 else 0 end) as HY_1995 ,

    sum(case when hiredate = '1996' then 1 else 0 end)...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: creating an investment data warehouse

    Matthew Cushing (5/13/2013)


    J Livingston SQL (5/13/2013)

    personally I would model this in excel and pivot tables first.....easy enough to create sample data.

    start planning on what you really want to analyse /...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

Viewing 15 posts - 1,636 through 1,650 (of 2,452 total)