Viewing 8 posts - 1 through 8 (of 8 total)
can you make it little more clear - in what scenario it will not work=?
Thanks
March 5, 2008 at 12:03 pm
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] +...
March 5, 2008 at 11:51 am
hi
I am not sure of that. I have never done that.
Thanks
March 3, 2008 at 10:37 am
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)...
March 3, 2008 at 10:01 am
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))...
March 3, 2008 at 9:42 am
Looks like Index on ADRES will not be used.
March 3, 2008 at 9:16 am
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)...
March 3, 2008 at 7:18 am
I hope this helps
select
FirstName
, lastName
, max(Case when ContractType = 'Fixed' then ContractType else '0' end)
+ ',' + max(Case when ContractType = 'TimeMaterial' then ContractType...
March 3, 2008 at 6:17 am
Viewing 8 posts - 1 through 8 (of 8 total)