Forum Replies Created

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

  • RE: Some T-sql help required

    Update A set deleted = (select case when sum (policyPremium) =0 then 1 else 0 end from [accountTable] I where I.PolicyID =a.PolicyID )

    from [accountTable] A

  • RE: Dedupe order by field

    select a.* from

    (

    select Postcode,min(Distance) as Distance from Tablename group by Postcode

    ) as O inner join Tablename a on a.Postcode=O.Postcode and a.Distance =O.Distance

  • RE: how to group by in tsql

    Select * from tablename order by schooltname desc,state ,city

  • RE: Update Statment Issue, Looking For Optimized solution

    Try this:

    update B set Value_2=Value_1 from @TABLE_2 B inner join @TABLE_1 A

    on Code_1=Code_2

  • RE: JOINS

    USE [TESS42LIVE]

    GO

    /****** Object: Trigger [dbo].[Trig_Part_No_Nominal] Script Date: 09/23/2009 08:36:43 ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    -- =============================================

    -- Author: Sam Marsden

    -- Create date: 22/09/2009

    --...

  • RE: Difference between tables

    Instead of your difference query use this

    select * from #temp_Phonenumber2

    except

    select * from #temp_Phonenumber1

  • RE: Need output

    Select A.NAME, A.VALUE, A.VERSION from

    (select row_number()over(partition by [name] order by VERSION desc ) as SlNo,* from #temp) as A

    where SlNo=1

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