-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Probleme mit union-Statement
PostPosted: Wed Aug 09, 2006 5:44 am 
Regular
Regular

Joined: Mon May 22, 2006 8:32 am
Posts: 67
Hallo an Alle,

ich versuche ein Statement zusammenzusetzen. Dabei benutze ich zwei Statements, die allein genommen ihre Arbeit tun. Verbinde ich beide mit dem in einem union, so bekomme ich nur das Ergebnis der ersten Abfrage.

Code:
select
   persacct.code,
   emppersacct.emp.empSk,
   emppersacct.nomDate,
   emppersacct.updTs,
   tcslogin.firstName,
   tcslogin.lastName,
   emppersacct.mi,
   'F'
from
   EmpPersAcct emppersacct
   left join emppersacct.tcsLogin tcslogin
   inner join emppersacct.persAcct persacct
   
where
   persacct.code='URLAUB'
   and
   emppersacct.emp.empSk=-979941237706

union
   select
      persacct.code,
      sprstatehrses.id.empSk,
      sprstatehrses.id.nomDate,
      sprstatehrses.updTs,
      emp.firstName,
      emp.lastName,
      sprstatehrses.mi,
      'T'
   from
      Emp emp
      inner join persacct.persAcctAssocs persacctassocs
      inner join emp.sprstateHrses sprstatehrses
      
   where
      sprstatehrses.id.sprstateSk = persacctassocs.id.sprstateSk
      and
      persacct.code='URLAUB'
      and
      sprstatehrses.id.empSk= -979941237706
   order by
      3 desc


Was mache ich falsch? Ich glaub ich stehe auf dem Schlauch!?

_________________
Regards,
ak


Please don't forgat to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.