使用两个输入值的sql查询更新 [英] sql query for update using two input valus

查看:92
本文介绍了使用两个输入值的sql查询更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,
我正在编写一个基于两个输入值更新值的sql查询.
仅当两个输入匹配时,才应更新该值.
如果我输入有误,请更正此查询.

Hi friends,
I am writing a sql query for updating value based on the two input values.
The value should be updated only when two inputs are matched.
Please correct this query if i made a mistake.

update Student_Contact_details 
set Contact_name = @contactname, 
    Contact_Relation = @contactrelation, 
    Phone_number = @phonenumber, 
    Alternative_phone_number = @alternativenumber, 
    Email_id=@emailid, 
    StreetAddress=@streetaddress, 
    City=@city, 
    State=@state, 
    Country=@country, 
    Zipcode=@zipcode, 
    Update_date_time=@updatedatetime 
where Contact_id = @contactid and Student_id = @studentid


感谢您提前提供帮助.


Thanks for help in advance.

推荐答案

您的查询将成功执行.前进.对自己的工作有信心,如果您对自己的工作有任何疑问,请寻求帮助.要求检查您的问题不是一个好习惯,没人知道您在做什么.

谢谢
Ashish
Your query will successfully execute. go ahead. Be confident about what you are doing, if you have any problem regarding what you are doing then ask for help. Its not a good habbit to ask to check your problem, no one knows for what you are doing this.

Thanks
Ashish


如果您想在两个条件都适用的地方进行更新,那您的句子是正确的.

关于
You''re sentence is correct if you want to update where the two conditions applies.

Regards


如果我做错了,请更正此查询"不是问题.您需要告诉它是对还是错?您的代码正常,然后需要查看其是否有效.有任何疑问吗?请参阅此..
http://www.w3schools.com/sql/sql_update.asp [
"Please correct this query if i made a mistake" isn''t a question.You need to tell whether it works right or wrong? Your code is OK,then you need to see whether it works or not.Any question?See this..
http://www.w3schools.com/sql/sql_update.asp[^]


这篇关于使用两个输入值的sql查询更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆