Skip to content
Loading
Update the value in db
  • Surya Vijay
    Thank you so much. I get confused because of this. I'm a beginner to ide and projects thats  why!?
    0
  • Sonu Gupta
    Hi,
     
    Go to below link --
     
    https://blog.sqlauthority.com/2013/04/30/sql-server-update-from-select-statement-using-join-in-update-statement-multiple-tables-in-update-statement/ 
    0
  • Surya Vijay
    String nqry = "UPDATE candidatee as a
    SET a.cVote = (SELECT[CountcVote]
    FROM[candidatee]
    WHERE cVote = @Sid) +1 where a.Sid = @Sid";
     
    candidatee is my table name.
    cVote is my column name.
    where i want to update is this right??
    @Rajanikant Hawaldar
    0
  • Rajanikant Hawaldar
    your query should be like this make changes if required, correct me if understand wrong
     
    1. UPDATE TypeYourTableName as a  
    2.    SET a.CountColumnName = ( SELECT [CountColumnName]   
    3.               FROM [TypeYourTableName]  
    4.               WHERE TypeHereColumnNameSid = @Sid) + 1 where a.Sid =@Sid  
     
    0
  • Surya Vijay
    please send me some example to pursue further.
     
    I get confused a whole day 
    0
  • Priyanka Jain
    You can use update command to update your count in your database field
    0