Forum Replies Created

Viewing 15 posts - 616 through 630 (of 1,923 total)

  • RE: Need a Query

    kishoremania (9/28/2011)


    Can I know why you used rank() for max_b and row_number() for max_c?

    For every value in A, i am using RANK to calculate the highest B , so i...

  • RE: Need a Query

    bkubicek (9/28/2011)


    kishoremania (9/28/2011)


    Actually the data will be like

    10 1 1

    10 1 2

    10 2 1

    10 2 2

    10 3 1

    10 3 2

    11 1 1

    11 1 2

    11 2 1...

  • RE: Need a Query

    How about this?

    declare @test-2 table ( a int, b int, c int )

    insert into @test-2 ( a, b , c)

    select...

  • RE: Tricky Ranking Problem...

    Can you please expand further on how you arrived at your desired result ? i am kinda stuck in understanding the requirement. Should we find the highest profit for Deal...

  • RE: UNION or other way to extract data?

    Yuri55 (9/26/2011)


    Probably:

    select id, type from myTbl where id in (select id from myTbl where type ='A')

    if I did not miss something

    That will give you all the rows that has A...

  • RE: Select top row and second top row from DIM table

    Thanks Gian for the wonderful set-up.

    SELECT *

    FROM (

    SELECT *

    , cnt = COUNT(*) OVER(PARTITION BY strategy_ID)

    , RN = ROW_NUMBER() OVER(PARTITION BY strategy_ID ORDER BY efct_start_dt DESC)

    ...

  • RE: TSQL Finding Windows Scheduled Task

    Write a CLR proc to find the windows tasks, summon that CLR in ur SQL 🙂

  • RE: Trying to group sums by fiscal year

    tina 77078 (9/19/2011)


    Sorry - didn't mean to be unprofessional. You just have NO IDEA how long I was struggling with this issue. I just wish I found this...

  • RE: Trying to group sums by fiscal year

    LutzM (9/19/2011)


    ColdCoffee (9/19/2011)


    tina 77078 (9/19/2011)


    Thanks Lutz, my new BFF..

    can i be ur BFF also ?? :ermm:

    Hey folks,

    just keep in mind, this is still a professional SQL Server site. 😎

    U...

  • RE: How to categorize patient encounters based on procedures done.

    ajenawsu (9/19/2011)


    SELECT 1 AS EncID, 'OB Visit' AS 'Category' UNION ALL

    SELECT 2 AS EncID, 'Other' AS 'Category' UNION ALL

    SELECT 3 AS EncID, 'Dental Visit' AS 'Category' UNION ALL

    SELECT 4 AS...

  • RE: substring with changing length

    Lowell (9/19/2011)


    i'm using the patindex a second time to find the comma, and then pulling the length of whatever is between the two.

    with stg_reporting([column 5])

    AS (

    SELECT '[jobname] [RPP] Info: [RPP]...

  • RE: substring with changing length

    This:

    DECLARE @Tab TABLE

    ( [Column 5] VARCHAR(200) )

    INSERT INTO @Tab

    SELECT '[jobname] [RPP] Info: [RPP] Job processed 0, Success: 0, Error: 0.'

    UNION ALL SELECT...

  • RE: Trying to group sums by fiscal year

    tina 77078 (9/19/2011)


    Thanks Lutz, my new BFF..

    can i be ur BFF also ?? :ermm:

  • RE: SQL cmd and error level

    it requires more than the switches to capture the information from a query to be passed to sqlcmd, i think..

  • RE: strings, substring, patterns (or lack of them)

    Lowell (9/16/2011)


    be sneaky and create it in tempdb database itself, then you can still use it:

    Wont objects in tempdb get dropped when the server restarts ?

    < i dint read...

Viewing 15 posts - 616 through 630 (of 1,923 total)