这是一个创建于 2943 天前的主题,其中的信息可能已经有所发展或是发生改变。
select distinct case ISNULL(p.iscomment,0) when 0 then '未评价' else '已评价' end zhuangtai from piproject p
left join PiEntpriseContacts s on p.entpriseid=s.entpriseid and s.enableflag=1
where 1=1 and p.enableflag=1 and (p.estate = 13 or p.PassNodeId=11313)
and p.CreateOn > dateadd(month,-3,GETDATE()) and (p.Mobile = '{0}' or s.mobile='{0}') and p.iscomment is null
{0}为变量
11 条回复 • 2016-05-27 07:47:32 +08:00
![zhangshu](https://cdn.v2ex.com/gravatar/97f9fce567581e11a4517f09ba7d4dcf?s=48&d=retro) |
|
1
zhangshu 2016-05-26 07:02:01 +08:00 via Android
我记着变量传进去不是要有 @ Mobile 的吗?难道是我记错了!
|
![bozong](https://cdn.v2ex.com/avatar/17a2/1640/122278_normal.png?m=1488349145) |
|
2
bozong 2016-05-26 08:46:50 +08:00 via iPhone
@ zhangshu 输入的话{0}换成 @参数 但是不知道怎么输出
|
![bozong](https://cdn.v2ex.com/avatar/17a2/1640/122278_normal.png?m=1488349145) |
|
3
bozong 2016-05-26 09:49:40 +08:00
//////////
|
![zhangshu](https://cdn.v2ex.com/gravatar/97f9fce567581e11a4517f09ba7d4dcf?s=48&d=retro) |
|
4
zhangshu 2016-05-26 13:15:25 +08:00 via Android
(Mobile=@Mobile)输入,输出:(exec ‘@Mobile :你要查的东西’)@Mobile :变量
|
![zhangshu](https://cdn.v2ex.com/gravatar/97f9fce567581e11a4517f09ba7d4dcf?s=48&d=retro) |
|
5
zhangshu 2016-05-26 13:15:46 +08:00 via Android
好像是这样,你试试
|
![bozong](https://cdn.v2ex.com/avatar/17a2/1640/122278_normal.png?m=1488349145) |
|
6
bozong 2016-05-26 13:44:31 +08:00
|
![zhangshu](https://cdn.v2ex.com/gravatar/97f9fce567581e11a4517f09ba7d4dcf?s=48&d=retro) |
|
8
zhangshu 2016-05-26 16:05:08 +08:00 via Android
对啊,你不是在你的数据库中,用的可编程性吗?
|
![bozong](https://cdn.v2ex.com/avatar/17a2/1640/122278_normal.png?m=1488349145) |
|
9
bozong 2016-05-26 17:09:55 +08:00 via iPhone
|
![bozong](https://cdn.v2ex.com/avatar/17a2/1640/122278_normal.png?m=1488349145) |
|
10
bozong 2016-05-26 17:10:49 +08:00 via iPhone
|
![zhangshu](https://cdn.v2ex.com/gravatar/97f9fce567581e11a4517f09ba7d4dcf?s=48&d=retro) |
|
11
zhangshu 2016-05-27 07:47:32 +08:00 via Android
1909622960
|