sql存储过程查询 [英] sql stored proc query

查看:70
本文介绍了sql存储过程查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个程序进行插入,因为在表中有7个工作日,所以假设我有下面提到的字段作为表格



 Id employeename field1 field2 field3 field4 





所有字段均为varchar数据类型



现在条件应该是当i 插入记录field1值不等于field2时,因为field1不等于field3而field1不等于to field4和field2不等于field3,field2不等于field4,field3不等于field4

解决方案

你是否传递了值通过页面...?



如果您通过页面传递值,请使用if检查条件。



  if (field1!= field2&& field1!= field3&& field1!= field4& & field2!= field3&& field2!= field4& ;& field3!= field4)
{
// insert query
}





我不确定这是你的期望,但根据我的理解,我给出了这个解决方案。


I want to Create a procedure for insert as in table have 7 weekdays such that suppose i have following fields mentioned below for the table as

Id  employeename   field1    field2   field3   field4



all fields are varchar data type

now condition should be that when i insert the record field1 value not equal to field2 so as for field1 not equal to field3 and field1 not equal to field4 and field2 not equal to field3 and field2 not equal to field4 and same for the field3 not equal to the field4

解决方案

Are You Passed the values via Page...?

If you pass the values via page then check the condition using "if".

if(field1!=field2 && field1!= field3 && field1 != field4 && field2 != field3 && field2 != field4 && field3!= field4)
{
// insert query
}



i''m not sure this is your expecting but as per my understanding i given this solution .


这篇关于sql存储过程查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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