Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)

  • RE: Converting rows into one column

    can you make it little more clear - in what scenario it will not work=?

    Thanks

  • RE: Converting rows into one column

    if you are using Sql server 2005 you use Pivot operation to perform this

    select firstName, lastName , left(ContractType ,len(ContractType)-1) as ContractType

    from (

    SELECT firstName, lastName , isnull([Fixed] +...

  • RE: HARD TO CREATGE SPECIAL VIEW

    hi

    I am not sure of that. I have never done that.

    Thanks

  • RE: Converting rows into one column

    if you are looking at my sol. then

    try this..

    select FirstName,lastName, left(ContractType, len(ContractType)-1) as ContractType

    from(

    select

    FirstName

    , lastName

    , isnull(max(Case when ContractType = 'Fixed' then ContractType else null end)...

  • RE: HARD TO CREATGE SPECIAL VIEW

    if you want to hit index try this

    Create function func1(@adrID smallint)

    returns table as

    return

    (

    select ADR_NAAM from dbo.ADRES

    where ADR_ID = @adrID

    )

    select

    SCHIP_ID

    , (Select ADR_NAAM from func1(REDER_ID))...

  • RE: HARD TO CREATGE SPECIAL VIEW

    Looks like Index on ADRES will not be used.

  • RE: HARD TO CREATGE SPECIAL VIEW

    try this...

    select SCHIP_ID

    , (select ADR_NAAM from dbo.ADRES where ADR_ID = dbo.SCHIP.REDER_ID) as Reder_NAME

    , (select ADR_NAAM from dbo.ADRES where ADR_ID = dbo.SCHIP.OWNER_ID)...

  • RE: Converting rows into one column

    I hope this helps

    select

    FirstName

    , lastName

    , max(Case when ContractType = 'Fixed' then ContractType else '0' end)

    + ',' + max(Case when ContractType = 'TimeMaterial' then ContractType...

Viewing 8 posts - 1 through 8 (of 8 total)