查询中获取空记录
我在 postgresql 中编写了一个查询,
select components.*
from sg_paycomponents components
left outer join tblextempinfo info
on info.c_company=components.company
where components.type ='RECURRING-AMOUNTS'
and components.cid not in (
select components
from sg_recurringamounts
where employee =400
)
and info.employee=400;
该查询给了我所有记录,但我希望在 sg_paycomponents 表中我也应该得到该记录,其中 type = 'RECURRING-AMOUNTS' 且公司为空,如果公司为空,我的查询不会给我任何记录一位请帮忙
I have one query written in postgresql
select components.*
from sg_paycomponents components
left outer join tblextempinfo info
on info.c_company=components.company
where components.type ='RECURRING-AMOUNTS'
and components.cid not in (
select components
from sg_recurringamounts
where employee =400
)
and info.employee=400;
this query giving me all record but i want that in sg_paycomponents table i should get that record also where type = 'RECURRING-AMOUNTS' and company is null my query is not giving me if company is null can any one plz help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更改:
至:
Change:
To: