2017-04-09 92 views
0
select * from 
(select child as enfant,title as libelle, COALESCE(parent ,child) as Parent 
from tree2) as tree2 
order by COALESCE(parent , 1),parent,enfant 

我在Postgres的写了这个查询和它的作品,但是当我在我的程序ASP C#中使用它,它不返回任何东西,就像他不要吨有任何数据 什么问题的任何帮助thnks和索里,我的英语SQL Postgres里

+0

那么它听起来像C#代码是什么原因呢。当您从C#运行查询时会发生什么? –

+0

请包含您的C#代码,以便我们可以查看是否有错误。 –

回答

0
select * from 
(select child as enfant,title as libelle, COALESCE(parent ,child) as Parent 
from tree2) as tree2 
order by COALESCE(parent , 1),parent,enfant 

是一样的...

select child as enfant, title as libelle, COALESCE(parent ,child) as Parent 
from tree2 
order by parent NULLS LAST, enfant NULLS LAST 

但在C#这是另一个问题,我们不能只是想不通的问题有没有任何信息都不知道。

0

萨拉姆 是奇怪,但我解决它只是,它在我的C#代码 任何方式thnks

用于查询 “选择孩子作为朗方,标题为libelle问题,COALESCE(父母,子女)从tree2 顺序由家长NULLS家长
LAST,朗方NULLS LAST” 赞成票是一样的我尝试它,它相当与URS明确thnks