SQL*PLUS Syntax for Concatenation

From: Dave Schellenberg <dschellenberg_at_man.net>
Date: 1995/08/22
Message-ID: <dschellenberg.6.0011DCDA_at_man.net>#1/1


We are running Oracle 7 on VAX/VMS. I have two questions dealing with SQL*PLUS (and maybe PL/SQL) that I need help with:

Question 1:

  I have two tables, call them table1 and table2. I want something like this:

   UPDATE TABLE1
    SET TABLE1.COL2 = concatenated CHARs from TABLE2.COL2     WHERE TABLE2.ID = TABLE1.ID;
   In other words, I just want to concatenate all of the strings from table2.column2, separating each with a space, and then set a much bigger CHAR in table1 to that string. I have no idea!

Question 2:

   I want to find the second-highest date in a column in a table. It is too easy to find the highest, using MAX( ), but I can't think of how to find the next highest.

Anyone here ever done either of these?

David Schellenberg
Winnipeg, Manitoba
dschellenberg_at_man.net Received on Tue Aug 22 1995 - 00:00:00 CEST

Original text of this message