Link to home
Create AccountLog in
Avatar of rgb192
rgb192Flag for United States of America

asked on

want to order by ppid desc

CREATE TABLE [dbo].[paypaldata](
      [ppid] [int] IDENTITY(1,1) NOT NULL,
      [ppdate] [datetime] NULL,
      [ppdata] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
      [ppdata2] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]





select t.*
from paypaldata t
where cast(t.ppdata as varchar(max)) in
            ( select cast(i.ppdata as varchar(max))
            from paypaldata i
            where i.ppdata is not null and cast(i.ppdata as varchar) <> 'test'
            group by cast(i.ppdata as varchar(max))
            having count(*) > 1 )
 


want to order by ppid desc
ASKER CERTIFIED SOLUTION
Avatar of Nathan Riley
Nathan Riley
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of rgb192

ASKER

thanks