【发布时间】:2014-08-08 05:39:08
【问题描述】:
我需要一个我的 sql 语句来选择类似的东西
SELECT present, wholeday, attendance
present 和wholeday 是给定的,而出勤是由现在和全天的组合产生的
if present == 1 and wholeday == 1 then attendance = 1
if present == 1 and wholeday == 0 then attendance = .5
if present == 0 and wholeday == 0 then attendance = 0
【问题讨论】:
-
所以您希望我们帮助您而不需要您的任何努力?
-
您已经掌握了逻辑,是什么阻碍了您编写 SQL 查询?
-
既然没有 case for present=0, wholeday=1,
(present + wholeday)/2.0应该怎么做?
标签: mysql sql phpmyadmin