File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
SQL to update column
Joined: Jun 30, 2006
Oct 25, 2010 20:35:14
I have a table with following columns:
id(PK), name, score_1, score_2, score_3, rating
First I have the data for all columns EXCEPT rating. Then I want to update "rating" for each row using this rule
if (score_1 + score_2 + score_3) > 90: rating = A
if it > 80 but < 90 : rating =B
How to write this sql ?
author & internet detective
Joined: May 26, 2003
Oct 25, 2010 21:01:01
You would need update statements. The easiest way to do this is to have one update statement for each letter grade. Try write an update statement for the first one and post here if you get stuck.
How To Ask Questions The Smart Way
Blogging on Certs:
SCEA Part 1
Part 2 & 3
Core Spring 3
TOGAF part 1
I agree. Here's the link:
subject: SQL to update column
Multiple Actions issue in JSF
Returning A List Of Variables From A Folder Of Documents And Returning Them Into A New Document
JSP attendance management project error
Using JSTL Data Displayed In Browser Is Getting Fixed To 24576 Bytes(24 KB)
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014