【发布时间】:2017-12-19 17:24:32
【问题描述】:
我有一个表,其列的值为 0、null 和 1。我需要具有非 0 值的记录,包括 null 和 1。我需要使用 eloquent 进行查询。
我的桌子是这样的:
id | user_id | medical | gsg |interview_result | flight | created_at
----------------------------------------------------------------------
1 | 1 | null | null | 1 | null | anydate
2 | 2 | 0 | null | 1 | null | anydate
3 | 3 | 1 | 1 | 1 | 1 | anydate
4 | 8 | 1 | 1 | 1 | 0 | anydate
请回答这个问题。我想要非 0 值,包括 null。 mysql + 雄辩。如果您提供雄辩的代码,那就太好了。
注意:gsg、medical、interview_result 应为非 0,包括 null。其他列不需要使用。
【问题讨论】:
-
这是 SQL 还是 HTML 表?
-
只是表中表示的sql数据,供参考。
-
为什么不只做一个 ASCII 表?