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 > Other > Ingres SQL documentation

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Sep 2004
Location: London, UK
Posts: 565
Question Ingres SQL documentation

Can anyone recommend a site for Ingres SQL documentation?

Also, how do you tell what version of Ingres you have? We are running queries to extract data from an Ingres database over ODBC.

One particular query we are having trouble with is something like this (Oracle equivalent):
Code:
SELECT account_no
     , MIN(LEAST(date1, date2))    AS first_bill_date
     , MAX(GREATEST(date1, date2)) AS last_bill_date
FROM   bill_history
GROUP BY account_no;
Thanks in advance
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Feb 2004
Posts: 18
You can find the Ingres version with this query:

select dbmsinfo('_version');

Computer Associate's web site has documentation. www.ca.com
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: Nov 2002
Posts: 33
There's no LEAST or GREATEST function as such. However you can use a CASE statement

Code:
SELECT account_no
     CASE WHEN MIN(date1) < MIN(date2) THEN MIN(date1) ELSE MIN(date2) END 
            AS first_bill_date,
     CASE WHEN MAX(date1) > MAX(date2) THEN MAX(date1) ELSE MAX(date2) END 
            AS last_bill_date
FROM   bill_history
GROUP BY account_no;
Look here for doc ftp://ftp.ca.com/pub/ingres/docs/
__________________
Paul Mason
Reply With Quote
  #4 (permalink)  
Old
Registered User
 
Join Date: Sep 2004
Location: London, UK
Posts: 565
Thanks guys.

The dbmsinfo tip revealed that we are connecting to an Ingres 2.0 database, and it seems CASE was not supported in that version.

However at least we now have an Ingres SQL manual and we know what we're dealing with, so we're in a much better position.
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