If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Tricky select statement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-03-10, 23:37
msreddy13 msreddy13 is offline
Registered User
 
Join Date: Oct 2010
Posts: 3
Tricky select statement

PHP Code:
Hi

I have the following data in one of the table 
'TestTab'

code,     finished_dtm,     end_dtm
===============================
ABC    (null)        (null)
ABC    2009-08-10    2009-08-10
ABC    2009
-08-01    2009-08-09
XYZ    2008
-02-04    2008-02-04    

How to write a select satement to 
return values when

if finished_dtm is null then return that record
else
  return 
max(end_daterecord

thank you 
Reply With Quote
  #2 (permalink)  
Old 11-04-10, 06:10
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
you've posted the exact same question in both this forum and the SQL Server forum

you can't be using both database systems at the same time ...
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 11-05-10, 09:59
dan.mueller@trnsw dan.mueller@trnsw is offline
Registered User
 
Join Date: Jul 2010
Posts: 7
Why are you trying to sell books here rather than helping the user? This is a forum, not a garage sale.
Reply With Quote
  #4 (permalink)  
Old 11-05-10, 10:47
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
haters gotta hate

it's called a signature, dood

you should get one too

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 11-05-10, 10:59
dan.mueller@trnsw dan.mueller@trnsw is offline
Registered User
 
Join Date: Jul 2010
Posts: 7
They probably have medication that would help you.
Reply With Quote
  #6 (permalink)  
Old 11-05-10, 11:07
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by dan.mueller@trnsw View Post
They probably have medication that would help you.
you're just brimming with compassion

like i said, haters gotta hate, and your jealousy doesn't look too good
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #7 (permalink)  
Old 11-05-10, 12:04
dan.mueller@trnsw dan.mueller@trnsw is offline
Registered User
 
Join Date: Jul 2010
Posts: 7
Dude, Get over yourself. Jealosy never entered the picture until your obviously overstated opinion of yourself prevailed. And the haters thing? What are you smoking? Where do you come up with this stuff?

My original point (which is still my point) is that someone asked for help and you tried to sell him a book. That (IMHO) rates you right up there with the guys who actually post they will give you more info only if you pay them. Don't you think that type of attitude is missing the whole point of a forum? I certainly do.

As for this ping pong match, you can have it. I am finished with you.
Reply With Quote
  #8 (permalink)  
Old 11-05-10, 12:11
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by dan.mueller@trnsw View Post
... and you tried to sell him a book.
that's ridiculous

obviously you are new to forums and don't understand signatures

Quote:
Originally Posted by dan.mueller@trnsw View Post
I am finished with you.
thank $deity for that
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #9 (permalink)  
Old 11-17-10, 07:21
Luis Santos Luis Santos is offline
Registered User
 
Join Date: Jun 2009
Location: Lisboa, Portugal
Posts: 51
Hi,

Wanna use 4gl for that or sql?
If you use 4gl is more easy, with sql i think you should use a function with foreach command.
You can use 4gl for that?
__________________
LS
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On