Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JDBC updating rows which contains same id, different value for each row
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


suresh anugandula
updating rows which contains same id, different value for each row
0 Answer(s)      3 years and 5 months ago
Posted in : JDBC


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.


Advertisement
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
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
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
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
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
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
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
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
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
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 row variable assigned the value of mysql_fetch_row ( ) function which accept..._fetch_row($result);   echo "<b>ID: </b>"
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
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. To explain... Java example program to get the object's ID  
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
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
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
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
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
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
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
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
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
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
Advertisements
 

 

 

DMCA.com