Azmat Chand
Azmat Chand

Reputation: 11

MySQL set with where condition

Please tell me how to apply this query.

I want to set first position in remarks, where student sgpa is the highest.

I've tried the following:

update mcs1 
set remarks = "First position" 
where sgpa = top 1 
order by sgpa asc

Upvotes: 1

Views: 65

Answers (1)

Thamilhan
Thamilhan

Reputation: 13313

If I understood your question clearly:

UPDATE mcs1
SET remarks = 'First position'
ORDER BY sgpa DESC
LIMIT 1

Set the remarks for the highest sgpa

Upvotes: 3

Related Questions