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



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

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 a month 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
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
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
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
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
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 DISPLAY ID IN TEXTBOX BASED ON COMBOBOX SELECTION IN A SAME PAGE
HOW TO DISPLAY ID IN TEXTBOX BASED ON COMBOBOX SELECTION IN A SAME PAGE  Dear sir, Am having one table called rolemaster. In that there are 2 fields... is how to get Roleid in textbox when i select Role_name from combobox in a same
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
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
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
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
for each
for each  Sir, is it possible to write bubble sort in java using for each loop ? or any two related nested loops using for each? Thanks in advance
Finding MAX value from emp_id column using SQL query?
Finding MAX value from emp_id column using SQL query?  I need... the command which selects max value till 10 but after that it fails to pick max value of emp id from the table.(Actually it picks up Max value using by looking at 1st
how to display each arraylist value on new page in jsp
how to display each arraylist value on new page in jsp  hi!!!! i want to display each arraylist value on new page in jsp????? and also want to access the arraylist values using next button..... any help would be appreciated
retrieve value from database on the basis of maximum id number
retrieve value from database on the basis of maximum id number  hi, i want to retrieve value of maximum id number from the database and show that value in jTextField.when the user clicks on the button that maximum id number
How many ways can we get the value of current session id?
How many ways can we get the value of current session id?  How many ways can we get the value of current session id
Updating using AngularJS
in Shopping.html. On clicking updating button for each row ( as like Remove button in each row) I want the items in table (for that row for which we clicked Update button...Updating using AngularJS  Shopping.html <!DOCTYPE HTML PUBLIC
How send different files to browser at same time ..example(pdf&html) want display in same request using servlet
How send different files to browser at same time ..example(pdf&html) want display in same request using servlet  package com.readfiles; import...); } } }![alt text][1] [1]: http://How send different files to browser
 

 

 

DMCA.com