BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BrahmanandaRao
Lapis Lazuli | Level 10
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

1 ACCEPTED SOLUTION

Accepted Solutions
japelin
Rhodochrosite | Level 12

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;

View solution in original post

4 REPLIES 4
japelin
Rhodochrosite | Level 12

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.

BrahmanandaRao
Lapis Lazuli | Level 10

How delete krishna's marks only

japelin
Rhodochrosite | Level 12

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;
BrahmanandaRao
Lapis Lazuli | Level 10
Thank You Japelin

sas-innovate-wordmark-2025-midnight.png

Register Today!

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.


Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1451 views
  • 0 likes
  • 2 in conversation