- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的数据库中有以下行。
profileID | startDate | endDate
-------------------|-------------------|--------------
Jr.software eng. |2012-07-01 |2030-01-01
..................|...................|..............
Eng |2013-03-28 |2013-03-28
..................|...................|..............
Sr.eng |2013-04-09 |2013-04-17
..................|...................|..............
CEO |2012-11-21 |
..................|...................|..............
以上行存储在我的数据库中。我想要得到像这样的条件的结果。
1. If endDate is null then I get only it related startDate.
就像上面的行一样,我的预期结果是
profileID | startDate | endDate
-------------------|-------------------|--------------
CEO |2012-11-21 |
..................|...................|..............
但是如果行是这样的那么
profileID | startDate | endDate
-------------------|-------------------|--------------
Jr.software eng. |2012-07-01 |2030-01-01
..................|...................|..............
Eng |2013-03-28 |2013-03-28
..................|...................|..............
Sr.eng |2013-04-09 |2013-04-17
那么我的预期结果是
profileID | startDate | endDate
-------------------|-------------------|--------------
Jr.software eng. |2012-07-01 |2030-01-01
..................|...................|..............
我需要一个 mysql 查询。
最佳答案
Select profileId, Case When endate is NULL then startDate
Else Max(EndDate) end As `Date`
From tablename
关于mysql - 如果 endDate 中没有空值,则查找最大日期?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16166328/
我正在使用predicateForEventsWithStartDate:endDate:calendars查找在给定的24小时内发生的所有事件。我希望当天发生任何 Activity 的所有 Acti
数据来自 Google Sheets API,因此 employees.stratdate、employees.enddate 等。 我需要能够仅显示过去在选定月份工作的员工。如果他们不再工作,但曾经
我有这个 Bootstrap 日期选择器配置: datePickerConfig: { changeMonth: true, numberOfMonths: 1, endDat
我需要对 StartDate 和 EndDate 进行验证 验证: StartDate 的设置值必须小于或等于 Endate。 EndDate 必须设置为大于或等于 startdate。 到目前为止我
我的数据库中有以下行。 profileID | startDate | endDate -------------------|-----------
有人可以告诉我这个查询中缺少什么吗?它不断出现: Error 1067: invalid default value for EndDate CREATE TABLE `course_info`( `
我有一个类模块,其中包含 private LocalDate startDate; private LocalDate endDate; private Map worked
当我将约会插入到 Exchange 中时,出现以下问题“EndDate 早于 StartDate”,有人可以帮忙解决这个问题吗? Appointment appt=new Appointment();
如何使用 linq 或 lambda 表达式获取开始日期和结束日期之间的日期列表。 DateTime StartDate = DateTime.Now; DateTime EndDate = Date
我正在努力进行日期计算来定义我自己的条形图系列范围。 我的动态日期是时间戳参数“timestamp1”、“timestamp2”、“timestamp3”、“timestamp4”,而我想创建间隔 i
我一直在编写一个脚本来获取一些证书的详细信息,而不是我已经在解决格式问题的过程中得到了格式化,现在当我尝试解析 EndDate="openssl s_client 时,脚本挂起-connect $ho
我有日期数组,我只需要获取介于两个不同日期(StartDate 和 EndDate)之间的那些日期。 谁能帮我解决这个问题... 提前致谢 最佳答案 假设您有 startDate 和 endDate
我制作了一个函数,它可以很好地处理 32 位日期(strtotime 可以接受),但它不可扩展。我需要随机生成人们的出生日期,所以我必须使用 DateTime(而且只有 format(DateTime
这个问题在这里已经有了答案: How do I loop through a date range? (17 个答案) 关闭 6 年前。 我有一个 DateTime StartDate 和 EndD
我想根据选项表单中选择的值动态设置 Bootstrap 日期选择器的 startDate 和 endDate 。 因此,如果我在选项中选择了 Boby,那么日期选择器将设置 startDate = 2
我在该命令的 enddate 输出中获得了额外的空间: $ export IP=google.com; nc -z -w 3 $IP 443 && (echo | openssl s_client
我有两个 LocalDate 声明如下: val startDate = LocalDate.of(2019, 10, 31) // 2019-10-31 val endDate = LocalDa
如何将 UK endDate 转换为 UTC,以便与 Node 上的 UTC 当前时间 (nowTime) 进行比较?还是换一种方式更好?将当前 UTC 时间转换为伦敦时区,然后与英国 endDate
在我的日期分页器中,我可以调用选定的日期并且它正在工作,但 startDate 和 endDate 不起作用。 我正在使用这个库 http://jondmiles.com/bootstrap-date
在我的数据库中有两列和如下数据 StartDate Enddate 2015-10-01 2015-10-30 2015-10-15 2015-11-15
我是一名优秀的程序员,十分优秀!