[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

defined with default NULL, but missing ...


Hi everybody,
I defined a field Date_End with default NULL, but am missing it.

CREATE TABLE Regions
( Country CHAR(4) NOT NULL,
  Date_Start CHAR(4) NOT NULL,
  Date_End CHAR(4) default NULL,  # this one ...
  Description CHAR(50)
) Engine = MyISAM;

Regions table is filled with a tab-delimited input table like:
0001    1997    2500     France
1000    1976                WORLD
1010    1976                INTRA-EUR

LOAD DATA INFILE '../Regions.txt' INTO TABLE Regions
FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n' IGNORE 0 LINES;
SELECT * FROM Regions WHERE Country >= 1000;
+---------+------------+----------+--------------+
| country | date_start | date_end | description |
+---------+------------+----------+--------------+
| 1000   | 1976          |                | WORLD |
| 1010   | 1976          |                | INTRA-EUR |
| 1011   | 1976          |                | EXTRA-EUR |
etc.

Question: why is NULL not shown for date_end ?

DELETE FROM Regions WHERE Country >= 1000 AND Date_End < 2001;
Query OK; 33 rows affected; 

SELECT * FROM Regions WHERE Country >= 1000;
Empty Set

Question: So NULL values are matching Date_End < 2001 in the DELETE ???

I am using MySQL version 5.0.15-nt. Help will be appreciated.
Cor Vegelin



Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.