proc sql;
create table students (name varchar(12),
address varchar(20),
marks num(3));
quit;
proc sql;
insert into students
values('Anand','Hyderabad',80)
values('Siva','Bangalore',65)
values('aditya','Rjy',65)
values('Krishna','Pune',65)
values('vasu','Vja',65);
quit;
proc sql;
delete from students
where name='Krishna' marks=65;
quit;
Here i want to delete kirshna marks how to delete rows conditionally
If you want to delete the value of a specific column instead of a row, use update.
proc sql;
update students
set marks=null /* set null or . */
where name='Krishna';
quit;
You can delete rows this way.
proc sql;
delete from students
where name='Krishna' and marks=65;
quit;
or
proc sql;
delete from students
where name='Krishna';
quit;
To specify multiple conditions, use And, Or, etc. to connect them.
How delete krishna's marks only
If you want to delete the value of a specific column instead of a row, use update.
proc sql;
update students
set marks=null /* set null or . */
where name='Krishna';
quit;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.