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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 2426 views
  • 0 likes
  • 2 in conversation