作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有 2 个表,其中一个表包含有关我拥有的所有应用程序的信息,其他表包含有关已安装所有应用程序的所有用户列表的信息。
如果我触发以下查询,它会给出我想要的正确结果,即主表中的所有记录以及设置表中的相应值
您可以在 http://sqlfiddle.com/#!2/5b39d/2 找到此结果
但是如果我更改缺少一些记录的用户,我会得到错误的结果,从而导致一个结果丢失。
您可以在 enter link description here 找到结果
请提供良好的查询以获取左侧的所有结果,右侧有一些缺失的数据。
最佳答案
Here, tablea and table2 is left and right table.
Col1 and col2 is common table both.
and col3 is which column is not found in table1 missing entry,
Ex:
select t1.* from table1 t1
left outer join table t2 on t1.colname1=t2colname2
where t2.colname3!=null
your Ex:
SELECT *
FROM `master_apps` `master`
LEFT OUTER JOIN `tbl_settings` `uas` ON `uas`.`app_id` = `master`.`id`
WHERE
master.app_active = "1"
AND uas.uid != NULL
关于mysql - 显示左表中的所有数据认为右表缺少一些数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13563618/
我收到这个查询: $query = mysql_query("SELECT arbejdsopgave.*, DATE_FORMAT(dato, '%d-%m
我是一名优秀的程序员,十分优秀!