Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Strange result with this SQL statement...

Re: Strange result with this SQL statement...

From: Kyriakos Lambros <kyriakos.lambros_at_lvvwd.com>
Date: 2000/03/21
Message-ID: <38D8093C.C8E1FE80@lvvwd.com>#1/1

When the table was created, the DEFAULT value for type may have been set to 1. This will put "1" in the field each and every time a null value is inserted into it. To remove the default, try ALTER TABLE average_table MODIFY (type <datatype> DEFAULT NULL);

Hope that helps.

Kyriakos Lambros
Programmer
Las Vegas Valley Water District

laulau823_at_my-deja.com wrote:

> Hello all,
> insert into average_table
> select max(id) id, max(custname) custname, '' type,
> avg(price) price, '' flag from main_table group by id;
> The average_table has the same column as the main_table. What I want
> to do is just taking the average of PRICE with each customer, put NULL
> values into column TYPE and FLAG. However, I find that the TYPE column
> are filled with character '1', while FLAG has the NULL values. What are
> the possible causes that the values of column TYPE are all filled with
> '1'?
> Thanks,
> David
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Tue Mar 21 2000 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US