Home > database >  SQL server needs to put the two rows of data offset each other, offset data is not total, urgent urg
SQL server needs to put the two rows of data offset each other, offset data is not total, urgent urg

Time:10-22



Consult everybody, have to cancel the logo data, statistical PatientID, now need to have the same PatientID but have cancel logo cancel each other out, have no idea, please comment,

CodePudding user response:

 select distinct PatientID from tableA a where not the exists (select top 1 1 from tableA where PatientID=Amy polumbo atientID and charindex (' cancel ', ItemName) & gt; 0) 
  • Related