updating rows which contains same id, different value for each row

updating rows which contains same id, different value for each row

Student table:

sid name age

3 suresh 24 2 surya 25 4 arya 26 1 kamal 23 1 karun 36 1 varun 36 1 anil 60 5 arun 50 5 ganga 60 5 gouna 30

From the above table we can identify that 4 rows with sid 1 and 3 rows with sid 5. Like this table may contains multiple records with same sid. Here my requirement is "I have to update those records which contains same sid basing on one condition. The condition is if more than 2 rows contains same sid then only i have to update those records. For example in the above table 4 rows are there with sid 1. I have to update these 4 rows like this

first row(having sid 1) with 'lilitha' as a value for name column
second row(having sid 1) with 80 as a value for age column
third row (having sid 1) with 'suri' as a value for name column
fourth row (having sid 1) with 40 as a value for age column"

like this i have to update the records with sid 5 also. please help me in resolving this problem.

View Answers









Related Tutorials/Questions & Answers:
updating rows which contains same id, different value for each row
updating rows which contains same id, different value for each row  ... rows with sid 5. Like this table may contains multiple records with same sid. Here my requirement is "I have to update those records which contains same sid
Updating rows who has same id with different values for each row from java program
Updating rows who has same id with different values for each row from java... rows with same id. student table: sid sname age 2 aruna 25 2... to update the records which contains sid 1. But i have to update first row
Advertisements
row_id
row_id  sir i have created a table my_table with two rows n two column with smillar name in each cell without any primary key , how can i change the first row and third column's name in sql server 2005 , kindly send me the query
row_id
row_id  sir i have created a table my_table with two rows n two column with smillar name in each cell without any primary key , how can i change the first row and third column's name in sql server 2005 , kindly send me the query
how to search the string arraylist contains database rows?
how to search the string arraylist contains database rows?  i need to search 2 database. one is excel database and another is SQL database. stored the row values into string arraylist. now i want to print the common rows existed
Insert specific fields into table dynamically for each row.
Insert specific fields into table dynamically for each row.  ... into the table. For this all the rows displayed and two rows with empty text boxes, he insert there for each row and for each row there is a button "done".if he click
Insert specific fields into table dynamically for each row.
Insert specific fields into table dynamically for each row.  ... into the table. For this all the rows displayed and two rows with empty text boxes, he insert there for each row and for each row there is a button "done".if he click
Delete a row from database by id
that contains entries of submittes form. Now there are 2 extra columns(10+2) for "DELETE" AND "UPDATE". On clicking delete which is hyper link that particular row...Delete a row from database by id  I m creating a small application
Adding button to each row for the table and adding row to another table
Adding button to each row for the table and adding row to another table  Hi I need to add button to each line in the table(Table data is retrived form database) and need to add that column data which we click in the specified
how to read the values for text and csv files and store those values into database in multiple rows..means one value for one row
table in multiple rows(which means one value for one row). eg: my file containes... into database in multiple rows..means one value for one row  Hai, I need... stored in database like names(column) siva divya ravi one value for one
Updating multiple value depending on checkboxes
Updating multiple value depending on checkboxes  Hi .. I want to Update the multiple values of database using checkboxes and want to set the session for selected checkboxes..? please answer if any one knows as soon as possible
Determining If a Preference Node Contains a Specific Value
Determining If a Preference Node Contains a Specific Value... to determine whether the Preference code contains the specified value or not by enumerating the key/value pairs in a preference node and checks each value for a match
data grid with edit and delete options at each row.
data grid with edit and delete options at each row.  i want to display the table data in the format of data grid with edit and delete options at each row. i need it very urgently. advance thanks
delete row using id
delete row using id  package pkg2; import org.hibernate.Query; import... = "delete from Insurance insurance where id = 2"; Query query = sess.createQuery(hql); int row = query.executeUpdate(); if (row == 0
Want to display Arraylist items on same row in JSF
Want to display Arraylist items on same row in JSF  I want do display values of one arraylist on same row using datatable? If i use h:column, then it goes on different row. Please tell me, how I can do it?   Hi Friend
login for different user in the same page
login for different user in the same page  how can i do the login for different user in the same page throug jsp
PHP SQL Rows
; PHP SQL Rows is used to fetch the select the row value based on the condition... the value of mysql_fetch_row ( ) function which accept the parameter result. Finally...;echo "<b>ID: </b>";   echo $row[0
ftech different value corresponding different value
ftech different value corresponding different value  in my dropdown two options are their and i want when i select any option the corresponding value that go in the database should be different. for eg. in my drop down
how to know which jList is selected and according to that fetch the value
, jList4) in 4 different tabs in frame. Each List has the value of employee_id... rows of databse with employee id as primary key) How to know which jList is selected so that i get the value of employee_id from the correct jList (i.e which
How to check if an arraylist contains a value in Java
How to check if an arraylist contains a value in Java  Hi, I have... to do this? How to check if an arraylist contains a value in Java? Thanks   Hi, One can use arraylist contains() method which is used to find
Set Different Color to different row in Java Program
Java Set Different Color to different row In this section, you will learn how to set different color to table row using java swing.For this purpose, we have.... This class provides the method setBackground() which allow us to set different
Hash value is not same - Java Beginners
Hash value is not same  Hi, I've two Excel files with same data.... I've generated one way hash using SHA-1 algorithm. But the hash value of Excel 2003 files is not same as the hash value of Excel 2007 file. What might
ModuleNotFoundError: No module named 'default_value_for_each_call'
ModuleNotFoundError: No module named 'default_value_for_each_call'  ...: No module named 'default_value_for_each_call' How to remove the ModuleNotFoundError: No module named 'default_value_for_each_call' error? Thanks
how to mark different colors for diffent rows - Java Beginners
how to mark different colors for diffent rows  Hi, i have drawn a simple table using swings and now i want to mark diffent colors for each row..............my target is to have each color for each row.......first row
different output trying to execute same java code
different output trying to execute same java code  i am using net... there is different output trying to execute same java code... to read value from serial port : import java.io.*; import java.util.*; import
Java Program to insert a row in the same sheet of excel file
Java Program to insert a row in the same sheet of excel file  Java program to insert a row in the same sheet of excel file using poi package in java
different output trying to execute same java code
different output trying to execute same java code  i am using net... " portList : false" Why there is different output trying to execute same java... to read value from serial port : import java.io.*; import java.util.*; import
different output trying to execute same java code
different output trying to execute same java code  i am using net... " portList : false" Why there is different output trying to execute same java... to read value from serial port : import java.io.*; import java.util.*; import
how to select the row value that was retrived from the database ?
how to select the row value that was retrived from the database ?  I... in the page in which i am getting all the data from the database has an another select... as for example Approve then it must select all the data in the row and send
how to select the row value that was retrived from the database ?
how to select the row value that was retrived from the database ?  I... in the page in which i am getting all the data from the database has an another select... as for example Approve then it must select all the data in the row and send
getting radio button at start of each row of table - Struts
getting radio button at start of each row of table  i have done the following things, and this is fine for me. But i want radio button at the place... at the start of each row as u saw in above output. So what should i have to do
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
Fix table's column's name row(1st row of the table) so that it does not move up when the table is scrolled up to view more rows below
the table rows up to view more underlying data, then, the table's header (1st row which contains the column's name also move. This creates trouble for the users...Fix table's column's name row(1st row of the table) so that it does not move up
How to print different Messge for the same NumberFormatException on different cause objects in JAVA?
How to print different Messge for the same NumberFormatException on different cause objects in JAVA?  How to print different Messge for the same NumberFormatException on different cause objects in JAVA? try { int
Column count doesn't match value count at row 1
Column count doesn't match value count at row 1  Column count doesn't match value count at row 1 UPDATE user_profile SET id=[value-1],user_id=[value-2],full_name=[value-3],mobile_phone=[value-4],hide_email_id=[value-5],hide
how to mark different colors for diffent rows - Java Beginners
how to mark different colors for diffent rows  Hi frends, Actually yesterday i had a question that, how can i mark colors to my rows in the table... in that frame...........only the table with colord rows is getting....... My
How to identify the radio button id and row id in a table in jsp?
How to identify the radio button id and row id in a table in jsp?  ...; table.rows[rowCount-1].cell[no].id="r"+rowCount+"c...; var row = table.insertRow(rowCount); var
Update a group of records with one value in the same group
Update a group of records with one value in the same group  I want.... If group does not have AA,BB,CC value then remains same (no need to update) . source... haveing one AA value in name column then those records NAME column should
Get form value in same page - JSP-Servlet
Get form value in same page  Hello friends, Can we get a form field value in the same to be processed in java coding. For example
Create an HTML file AddCookies.html which contains four text boxes
Create an HTML file AddCookies.html which contains four text boxes  Create an HTML file AddCookies.html which contains four text boxes .When user enters the values in these text boxes and press the submit button, the values
Java example program to get the object's ID
specific method that provides us the object's ID. But each object has its own unique hash value which can be treated as unique Id for that object.ADS_TO_REPLACE_1... Java example program to get the object's ID  
how to make seperate view count for each row while clicking view button
how to make seperate view count for each row while clicking view button ... count should be happen for each row here is my code ** Tabledata.jsp <...="java.sql.Connection"%> function editRecord(id){ var f=document.form
If Sessin Contain Array how can i get each value.
If Sessin Contain Array how can i get each value.  sir, i m trying to get value form session and session contain array i mean .. whatever... to use this value in different conditions..so how can i get it.. Thank u
Difference between class,name,id attributes in each JSP tag
Difference between class,name,id attributes in each JSP tag  Can i know the difference between class,name,id attributes in each JSP tags.................. These 3 are only used for reference ..... And what are the differernces
Grid rows delete issue
index value which is we removed.so my for loop to remove all rows stop at middle... to bypass that row index which is we removed and go forward to remove all rows" plz... event of dropdown also,so if we delete middle row and then remove all rows

Ads