我是靠谱客的博主 安静咖啡,最近开发中收集的这篇文章主要介绍mysql中where后left,使用WHERE子句的MySQL LEFT JOIN查询,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

Hope someone can help as I am having a hard time understanding how to query properly

I have a Member table and a Member_Card table. Member_Card has a column Member, so the card is associated to a member. Both tables have a LastModifiedDate column. A member can have none, one or several cards.

I need to return all members whose LastModifiedDate >= sinceDate (given date) OR whose card (if any) LastModifiedDate >= sinceDate.

Imagine sinceDate is 2013-01-01 00:00:00. I want to output something like this:

[{

"Id": "001O000000FsAs7IAF",

"LastModifiedDate": 2013-01-01 00:00:00,

"Member_Card": null

}, {

"Id": "001O000000FrpIXIAZ",

"LastModifiedDate": 2012-12-12 00:00:00,

"Member_Card": [{

"Id": "

最后

以上就是安静咖啡为你收集整理的mysql中where后left,使用WHERE子句的MySQL LEFT JOIN查询的全部内容,希望文章能够帮你解决mysql中where后left,使用WHERE子句的MySQL LEFT JOIN查询所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(53)

评论列表共有 0 条评论

立即
投稿
返回
顶部