Results 1 to 4 of 4
  1. #1
    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

  2. #2
    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

  3. #3
    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

  4. #4
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •