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: Need help with logical query
PostPosted: Thu Dec 04, 2008 2:24 pm 
Newbie

Joined: Thu Dec 04, 2008 2:19 pm
Posts: 1
I need to retreive rows based on an expression,

here is the case

id name countrycode
1 joe CA
2 mark FR
3 max XX


i need a query that will look for an entry where countrycode=CA, if nothin exist, it will return XX

for instance, if i ask the name where countrycode=CA, it will return joe. If i as a name where the countrycode=US, it will return max.

Can someone tell me how i can exprees that inside one query

Regards


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.