Re: How to change where NULL values sort?

2009-04-18 Thread Martijn Engler
They'll normally sort at the top, unless you use ORDER BY DESC. Anyway, fixing that is easy: SELECT col1, col1 IS NULL AS isnull FROM tbl1 ORDER BY isnull DESC, col1 ASC That should give you the results ordered by col1, with the null-values at the top. - Martijn On Sat, Apr 18, 2009 at

How to change where NULL values sort?

2009-04-18 Thread David M. Karr
I think normally NULL values will sort at the end, correct? I believe there's a way to make NULL values sort at the beginning, but I can't remember how to do it. I just searched a couple of MySQL resources, but I couldn't find it. -- MySQL General Mailing List For list

Re: Inserting null values in mysql with PHP

2007-08-10 Thread Michael Dykman
My apologies.. I scanned back looking for the reference but couldn't find it... I thought it worth reiterating what turned out to be your point because there seems to be so much confusion around this issue. - michael On 8/9/07, Brent Baisley <[EMAIL PROTECTED]> wrote: > Actually, I said to m

Re: Inserting null values in mysql with PHP

2007-08-09 Thread Michael Dykman
IF it is a null in that column, you should not see the word 'null'.. and the advise to put quotes around it I read earlier in this thread is completely misguided.. If you insert the string 'null' or 'NULL' into the database, you have just strored a string.. Perhaps it is the form of your queries

Re: Inserting null values in mysql with PHP

2007-08-09 Thread Mahmoud Badreddine
I did remove that column from the insert statement and no text appeared at all in that field under that column. Not even the word "NULL". On 8/8/07, Christian High <[EMAIL PROTECTED]> wrote: > > On 8/8/07, Brent Baisley <[EMAIL PROTECTED]> wrote: > > One thing to check is to make sure you are not

Re: Inserting null values in mysql with PHP

2007-08-09 Thread Mahmoud Badreddine
Hi I added the following statement at the end of the my.cnf file: sql-mode="STRICT_ALL_TABLES,ALLOW_INVALID_DATES" but I still got the values 0 and 0.00 where no values were entered. I did restart the the mysql daemon of course. What am I still doing wrong? Thanks. On 8/8/07, Christian High <

Re: Inserting null values in mysql with PHP

2007-08-08 Thread Christian High
On 8/8/07, Brent Baisley <[EMAIL PROTECTED]> wrote: > One thing to check is to make sure you are not quoting your NULL > value for your insert statement. MySQL will try to convert that to a > numeric value, which may end up as 0. > > On Aug 8, 2007, at 12:55 PM, Mahmoud Badreddine wrote: > > > Hell

Re: Inserting null values in mysql with PHP

2007-08-08 Thread Brent Baisley
One thing to check is to make sure you are not quoting your NULL value for your insert statement. MySQL will try to convert that to a numeric value, which may end up as 0. On Aug 8, 2007, at 12:55 PM, Mahmoud Badreddine wrote: Hello I have a table which contain a few numerical values. I set

Re: Inserting null values in mysql with PHP

2007-08-08 Thread Michael Dykman
That is MySQL, not PHP doing that to you. You need to set your SQL_MODE to strict to get that kind of behavior.. there are other implications to this mode so you should review: http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html - michael On 8/8/07, Mahmoud Badreddine <[EMAIL PROTECTE

Inserting null values in mysql with PHP

2007-08-08 Thread Mahmoud Badreddine
Hello I have a table which contain a few numerical values. I set the default values to be NULL. When I insert values using phpMyAdmin, it sets the values to NULL correctly. But when I insert using a PHP script that I wrote it sets the values to 0.00or 0. In my script I do test if the values are emp

Re: Do NULL values slow down the database?

2007-03-29 Thread Ananda Kumar
you in meaningful separating columns into tables as you descibed it. I had just impression, that mysql have some inner algoritmic issue with dealing with NULL values. Rgrds. Ales On 3/29/07, Jay Pipes <[EMAIL PROTECTED]> wrote: > Ales Zoulek wrote: > > Hi, > > > > I

Re: Do NULL values slow down the database?

2007-03-29 Thread Ales Zoulek
Thanks a lot. I agree with you in meaningful separating columns into tables as you descibed it. I had just impression, that mysql have some inner algoritmic issue with dealing with NULL values. Rgrds. Ales On 3/29/07, Jay Pipes <[EMAIL PROTECTED]> wrote: Ales Zoulek wrote: > Hi,

Re: Do NULL values slow down the database?

2007-03-29 Thread Jay Pipes
Ales Zoulek wrote: Hi, I've read reacently, that it's not good to use columns with NULL values in MySQL, because it slows down the select queries over that columns. Is it true? Or do that affects only some situations or some versions? Are there some relevant statistics about that?

Do NULL values slow down the database?

2007-03-29 Thread Ales Zoulek
Hi, I've read reacently, that it's not good to use columns with NULL values in MySQL, because it slows down the select queries over that columns. Is it true? Or do that affects only some situations or some versions? Are there some relevant statistics about that? Thanks a lot, Ales

Handling of NULL values when importing data from SQL Server BCP files

2007-03-28 Thread Dan Buettner
In the category of terrible, horrible, no good, very bad (but at least documented) software behavior, I bumped into this today: http://bugs.mysql.com/bug.php?id=14770 where the LOAD DATA INFILE command does not respect the default value of a column if no value is supplied in the file. Instead, it

Re: Mysql -e "Select" Fields Enclosed By and NULL values

2006-10-27 Thread Ow Mun Heng
On Fri, 2006-10-27 at 11:16 -0500, Gerald L. Clark wrote: > Ow Mun Heng wrote: > > Hi, > > > > I'm trying to load some data from a primary MySQL DB into a VMware image > > for R&D purposes. > > Instead of doing a mysqldump of nearly 10G of data, I would like to just > > select a subset of it and l

Re: Mysql -e "Select" Fields Enclosed By and NULL values

2006-10-27 Thread Gerald L. Clark
Ow Mun Heng wrote: Hi, I'm trying to load some data from a primary MySQL DB into a VMware image for R&D purposes. Instead of doing a mysqldump of nearly 10G of data, I would like to just select a subset of it and load it into the VMware image. man mysqldump You will find it supports a where c

Mysql -e "Select" Fields Enclosed By and NULL values

2006-10-27 Thread Ow Mun Heng
Hi, I'm trying to load some data from a primary MySQL DB into a VMware image for R&D purposes. Instead of doing a mysqldump of nearly 10G of data, I would like to just select a subset of it and load it into the VMware image. I'm facing a snag with regard to NULL values. I've

Re: Sqsh + NULL Values

2006-10-07 Thread Ow Mun Heng
e replication, I'm now > using sqsh to do it via the CLI. > > $sqsh -S Server -U user -i ~/bcp.txt -L bcp_colsep=',' -L datetime='%Y-% > m-%d %H:%M:%S' > > then using mysql's load data infile to do the inputing. > > I have a problem in that NUL

Sqsh + NULL Values

2006-10-06 Thread Ow Mun Heng
i ~/bcp.txt -L bcp_colsep=',' -L datetime='%Y-% m-%d %H:%M:%S' then using mysql's load data infile to do the inputing. I have a problem in that NULL values are not being returned as NULL. eg: the outputing bcp file will be AAA,2006-07-09 12:00:00,,BBB the field between th

Re: Bug or No bug - Composite Unique Key using null values

2006-10-06 Thread Martijn Tonies
> I have been mulling over this for a few days reading docs and going back and > forth with people on this, so I figured I would come here before writing up a > bug report. > > First of all, I have tested this on 4.1.18, 5.0.16, and 5.0.22 within Solaris > 9 and Mandrake Linux LE 2005 environments

Re: Bug or No bug - Composite Unique Key using null values

2006-10-06 Thread Dan Buettner
This constraint does not apply to NULL values except for the BDB storage engine. For other engines, a UNIQUE index allows multiple NULL values for columns that can contain NULL." Dan On 10/6/06, Dan Julson <[EMAIL PROTECTED]> wrote: List, I have been mulling over this for a few days readin

Bug or No bug - Composite Unique Key using null values

2006-10-06 Thread Dan Julson
List, I have been mulling over this for a few days reading docs and going back and forth with people on this, so I figured I would come here before writing up a bug report. First of all, I have tested this on 4.1.18, 5.0.16, and 5.0.22 within Solaris 9 and Mandrake Linux LE 2005 environments

Re: how to suppress NULL values in SELECT ... INTO OUTFILE ?

2006-04-02 Thread C.R.Vegelin
Lines Terminated By '\r\n' ... I do get results like 1;2;;4;;2;9 without NULLs or quotes. Regards, Cor - Original Message - From: "Jorrit Kronjee" <[EMAIL PROTECTED]> To: Sent: Sunday, April 02, 2006 11:33 AM Subject: Re: how to suppress NULL values in

Re: how to suppress NULL values in SELECT ... INTO OUTFILE ?

2006-04-02 Thread Jorrit Kronjee
Cor, You can set the enclosing character with the ENCLOSED BY parameter. So something like ENCLOSED BY '' will remove those quotes. - Jorrit C.R.Vegelin wrote: Thanks Paul, Yes, I've tried IFNULL() to map NULL values to empty strings. But then I get "1";"2"

Re: how to suppress NULL values in SELECT ... INTO OUTFILE ?

2006-04-01 Thread C.R.Vegelin
Thanks Paul, Yes, I've tried IFNULL() to map NULL values to empty strings. But then I get "1";"2";"";"4";"";"2";"9" in stead of 1;2;;4;;2;9 So building CSV files with 1;2;;4;;2;9 output is not possible ? Maybe an idea t

Re: how to suppress NULL values in SELECT ... INTO OUTFILE ?

2006-04-01 Thread Paul DuBois
At 13:29 +0100 4/1/06, C.R.Vegelin wrote: Hi everyone, I am struggling to make a CSV file, with rows like: 1;2;;4;;2;9 where NULL values are suppressed in the CSV file. I tried the following alternatives: a) Select ... Into Outfile ... Fields Terminated By ';' Escaped By ''

how to suppress NULL values in SELECT ... INTO OUTFILE ?

2006-04-01 Thread C.R.Vegelin
Hi everyone, I am struggling to make a CSV file, with rows like: 1;2;;4;;2;9 where NULL values are suppressed in the CSV file. I tried the following alternatives: a) Select ... Into Outfile ... Fields Terminated By ';' Escaped By '' Lines Terminated By '\r\n&#x

Re: not null values

2005-08-29 Thread Michael Stassen
joshua pereira wrote: i want to make it so that i will have to fill in all the attributes in .so i put not null for all the attributes. Is this correct ?? when for example do not fill in user_name , all the other values is accepted and stored in the databaseplease advise create table user_d

RE: not null values

2005-08-29 Thread Sujay Koduri
05 5:24 PM To: mysql@lists.mysql.com Subject: not null values i want to make it so that i will have to fill in all the attributes in .so i put not null for all the attributes. Is this correct ?? when for example do not fill in user_name , all the other values is accepted and stored in the datab

not null values

2005-08-29 Thread joshua pereira
i want to make it so that i will have to fill in all the attributes in .so i put not null for all the attributes. Is this correct ?? when for example do not fill in user_name , all the other values is accepted and stored in the databaseplease advise create table user_details (user_id varchar(

Re: SELECT ... JOIN with NULL values

2005-08-26 Thread SGreen
ARY KEY, > >>data_col2 int NOT NULL > >>) ENGINE=InnoDB; > >> > >>CREATE TABLE tbl1 ( > >>id INT NOT NULL auto_increment PRIMARY KEY, > >>id_tbl2 int NULL, > >>data_col1 int NOT NULL, > >> > >>INDEX (id_tbl2), > >

Re: SELECT ... JOIN with NULL values

2005-08-26 Thread Nuno Pereira
T NULL auto_increment PRIMARY KEY, id_tbl2 int NULL, data_col1 int NOT NULL, INDEX (id_tbl2), FOREIGN KEY (id_tbl2) REFERENCES tbl2(id) ON UPDATE CASCADE ) ENGINE=InnoDB; but i have NULL values in t.id_tbl2. Here is some data: mysql> INSERT INTO tbl2 VALUES (NULL, 11),(NULL, 12); Query OK, 2 rows

Re: SELECT ... JOIN with NULL values

2005-08-26 Thread Nuno Pereira
InnoDB; but i have NULL values in t.id_tbl2. Here is some data: mysql> INSERT INTO tbl2 VALUES (NULL, 11),(NULL, 12); Query OK, 2 rows affected (0.01 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> SELECT * FROM tbl2; ++---+ | id | data_col2 | ++---+ | 5 |

Re: SELECT ... JOIN with NULL values

2005-08-26 Thread SGreen
> FOREIGN KEY (id_tbl2) >REFERENCES tbl2(id) ON UPDATE CASCADE > ) ENGINE=InnoDB; > > but i have NULL values in t.id_tbl2. > > Here is some data: > > mysql> INSERT INTO tbl2 VALUES (NULL, 11),(NULL, 12); > Query OK, 2 rows affected (0.01 sec) > Records:

SELECT ... JOIN with NULL values

2005-08-26 Thread Nuno Pereira
; CREATE TABLE tbl1 ( id INT NOT NULL auto_increment PRIMARY KEY, id_tbl2 int NULL, data_col1 int NOT NULL, INDEX (id_tbl2), FOREIGN KEY (id_tbl2) REFERENCES tbl2(id) ON UPDATE CASCADE ) ENGINE=InnoDB; but i have NULL values in t.id_tbl2. Here is some data: mysql> INSERT INTO tbl2 VALUES (N

Re: UNIQUE Key Allowing Duplicate NULL Values

2005-02-23 Thread Harald Fuchs
fference between NULL and BLANK. It's not that I don't want > NULL values, it's that I don't want MORE THAN ONE. You really should change your requirements. Since NULL != NULL, every DB enforcing a single NULL row by a unique index would not be SQL. You seem to want "so

Re: UNIQUE Key Allowing Duplicate NULL Values

2005-02-23 Thread Martijn Tonies
pache configuration script to add the proper lines to my httpd.conf > file. Storing it this way doesn't make sense then ... If you need to be able to store multiple aliasses, use a parent-child relationship. > Now, suppose I try to add an alias to another web site - mrpcusa.net. &g

Re: UNIQUE Key Allowing Duplicate NULL Values

2005-02-23 Thread Martijn Tonies
> The problem is that I don't want more than one row in the table that has > a null value in the column. As you've pointed out in your e-mail, > there's a difference between NULL and BLANK. It's not that I don't want > NULL values, it's that I don&#x

RE: UNIQUE Key Allowing Duplicate NULL Values

2005-02-23 Thread Gustafson, Tim
Martijn, The problem is that I don't want more than one row in the table that has a null value in the column. As you've pointed out in your e-mail, there's a difference between NULL and BLANK. It's not that I don't want NULL values, it's that I don't wan

Re: UNIQUE Key Allowing Duplicate NULL Values

2005-02-23 Thread Martijn Tonies
Tim, > Oh well, thanks anyhow. > > If I could put in a feature suggestion, it would be a flag that I could > set to disallow duplicate nulls. :) What for? NULL is not equal to NULL. Period. If you don't want NULLs, make the column "not null". The specification is correct. With regards, Mart

RE: UNIQUE Key Allowing Duplicate NULL Values

2005-02-23 Thread Gustafson, Tim
/ -Original Message- From: Paul DuBois [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 23, 2005 8:14 AM To: Gustafson, Tim; mysql@lists.mysql.com Subject: RE: UNIQUE Key Allowing Duplicate NULL Values At 8:10 -0500 2/23/05, Gustafson, Tim wrote: >Is there any flag I can set on

RE: UNIQUE Key Allowing Duplicate NULL Values

2005-02-23 Thread Paul DuBois
x27;d have to use a BDB table, because only BDB allows a single NULL per UNIQUE index. -Original Message- From: Paul DuBois [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 22, 2005 3:13 PM To: Gustafson, Tim; mysql@lists.mysql.com Subject: Re: UNIQUE Key Allowing Duplicate NULL Values At

RE: UNIQUE Key Allowing Duplicate NULL Values

2005-02-23 Thread Gustafson, Tim
:[EMAIL PROTECTED] Sent: Tuesday, February 22, 2005 3:13 PM To: Gustafson, Tim; mysql@lists.mysql.com Subject: Re: UNIQUE Key Allowing Duplicate NULL Values At 15:00 -0500 2/22/05, Gustafson, Tim wrote: >Hi there! > >I have a table, defined as follows: > >CREATE TABLE `Web

Re: UNIQUE Key Allowing Duplicate NULL Values

2005-02-22 Thread Paul DuBois
--+ And I can insert even more NULL rows if I want to. Shouldn't the UNIQUE key prevent this from happening? Not for NULL values, no. See the description for UNIQUE indexes here: http://dev.mysql.com/doc/mysql/en/create-table.html -- Paul DuBois, MySQL Documentation Team Madison

UNIQUE Key Allowing Duplicate NULL Values

2005-02-22 Thread Gustafson, Tim
Hi there! I have a table, defined as follows: CREATE TABLE `WebSiteDomainNames` ( `ID` int(10) unsigned NOT NULL auto_increment, `WebSite` int(10) unsigned NOT NULL default '0', `DomainName` int(10) unsigned NOT NULL default '0', `Alias` char(16) default NULL, PRIMARY KEY (`ID`), UNI

Re: Selecting first non-null values from a set of rows

2005-02-08 Thread Bastian Balthazar Bux
1 row of the first non-null values from every column.. the row: A3 B1 C4. Like the COALESCE function in MySQL, but on rows. Please help... -thanks, Eli SELECT * FROM tab WHERE ISNULL(col1) LIMIT 1 UNION SELECT * FROM tab WHERE ISNULL(col2) LIMIT 1 UNION SELECT * FROM tab WHERE ISNULL(col3) LIMIT 1 In

Re: Selecting first non-null values from a set of rows

2005-02-08 Thread SGreen
> col1 col2col3 > >>> --- > >>> NULLB1NULL > >>> NULLNULLNULL > >>> A3 B3 NULL > >>> A4 NULLC4 > >>> A5 B5 C5 > >>> NULLB6 C6 > >&

Re: Selecting first non-null values from a set of rows

2005-02-08 Thread Eli
to keep the rows in that order). I want to get 1 row of the first non-null values from every column.. the row: A3 B1 C4. Like the COALESCE function in MySQL, but on rows. Please help... -thanks, Eli IF you want all 3 columns to be non-null, make that a condition of your query. SELECT col1, col2

Re: Selecting first non-null values from a set of rows

2005-02-08 Thread SGreen
A5 B5 C5 > NULLB6 C6 > > (It's important to keep the rows in that order). > I want to get 1 row of the first non-null values from every column.. the > row: A3 B1 C4. > > Like the COALESCE function in MySQL, but on rows. > > Please help... >

Selecting first non-null values from a set of rows

2005-02-08 Thread Eli
t non-null values from every column.. the row: A3 B1 C4. Like the COALESCE function in MySQL, but on rows. Please help... -thanks, Eli -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

RE: not all rows returned when using order by and null values?

2005-01-04 Thread John McCaskey
: Re: not all rows returned when using order by and null values? Even more interesting...: mysql> (SELECT avg FROM event_log_5minute_20050104 WHERE monitor_id=479139 AND monitor_server_id=1 AND timestamp >= 2005010408 AND timestamp < 2005010508) order by avg; +---

Re: not all rows returned when using order by and null values?

2005-01-04 Thread John McCaskey
wrote: > > > - Original Message - > > > From: "John McCaskey" <[EMAIL PROTECTED]> > > > To: > > > Sent: Tuesday, January 04, 2005 5:22 PM > > > Subject: not all rows returned when using order by and null values? > > > >

Re: not all rows returned when using order by and null values?

2005-01-04 Thread John McCaskey
> > Sent: Tuesday, January 04, 2005 5:22 PM > > Subject: not all rows returned when using order by and null values? > > > > > > > See below: > > > mysql> (SELECT avg FROM event_log_5minute_20050104 WHERE > > > monitor_id=479139 AND monitor_se

Re: not all rows returned when using order by and null values?

2005-01-04 Thread John McCaskey
On Tue, 2005-01-04 at 17:43 -0500, Rhino wrote: > - Original Message - > From: "John McCaskey" <[EMAIL PROTECTED]> > To: > Sent: Tuesday, January 04, 2005 5:22 PM > Subject: not all rows returned when using order by and null values? > > >

Re: not all rows returned when using order by and null values?

2005-01-04 Thread Rhino
- Original Message - From: "John McCaskey" <[EMAIL PROTECTED]> To: Sent: Tuesday, January 04, 2005 5:22 PM Subject: not all rows returned when using order by and null values? > See below: > mysql> (SELECT avg FROM event_log_5minute_20050104 WHER

not all rows returned when using order by and null values?

2005-01-04 Thread John McCaskey
See below: mysql> (SELECT avg FROM event_log_5minute_20050104 WHERE monitor_id=479139 AND monitor_server_id=1 AND timestamp >= 2005010408 AND timestamp < 2005010508 order by avg); +-+ | avg | +-+ |NULL | |NULL | |NULL | |NULL | |NULL | | 55854.1 | | 5

RE: sum() Function and NULL values

2004-12-16 Thread Gustafson, Tim
Thanks for all your responses. I went with the coalesce way - it works like a charm. Thanks again! Tim Gustafson MEI Technology Consulting, Inc [EMAIL PROTECTED] (516) 379-0001 Office (516) 480-1870 Mobile/Emergencies (516) 908-4185 Fax http://www.meitech.com/ -- MySQL General Mailing List F

RE: sum() Function and NULL values

2004-12-16 Thread SGreen
"Jay Blanchard" <[EMAIL PROTECTED]> wrote on 12/16/2004 01:00:00 PM: > [snip] > Is there any way to make sum() return "0" instead of "NULL" when one or > more of the rows being sum()'d is null? > > Phrased another way, is there a way to make mySQL treat "NULL" as "0" > when dealing with mathemat

Re: sum() Function and NULL values

2004-12-16 Thread beacker
>Is there any way to make sum() return "0" instead of "NULL" when one or >more of the rows being sum()'d is null? > >Phrased another way, is there a way to make mySQL treat "NULL" as "0" >when dealing with mathematical functions? You can use ifnull select sum(ifnull(points,0)) from abc;

RE: sum() Function and NULL values

2004-12-16 Thread Jay Blanchard
[snip] Is there any way to make sum() return "0" instead of "NULL" when one or more of the rows being sum()'d is null? Phrased another way, is there a way to make mySQL treat "NULL" as "0" when dealing with mathematical functions? [/snip] Use an IF... SELECT SUM(IF(myColumn IS NULL, 0, myColumn)

Re: sum() Function and NULL values

2004-12-16 Thread Johan Höök
Hi Tim, I guess you can add something like this to your statement: SELECT COALESCE( SUM(column) , 0 ) FROM ... /Johan Gustafson, Tim wrote: Is there any way to make sum() return "0" instead of "NULL" when one or more of the rows being sum()'d is null? Phrased another way, is there a way to make myS

sum() Function and NULL values

2004-12-16 Thread Gustafson, Tim
Is there any way to make sum() return "0" instead of "NULL" when one or more of the rows being sum()'d is null? Phrased another way, is there a way to make mySQL treat "NULL" as "0" when dealing with mathematical functions? Tim Gustafson MEI Technology Consulting, Inc [EMAIL PROTECTED] (516) 379-

Re: NULL values from LOAD DATA infile

2004-11-08 Thread Keith Ivey
Rachael LaPorte Taylor wrote: I'm trying to import a file using LOAD DATA INFILE into a table containing columns that default to NULL. See http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html : | Handling of NULL values varies according to the FIELDS and LINES options in use: | | * Fo

NULL values from LOAD DATA infile

2004-11-08 Thread Rachael LaPorte Taylor
I'm trying to import a file using LOAD DATA INFILE into a table containing columns that default to NULL. However, values load into the table as 0 (zeros). What can I do to have these default to NULL? mysql> describe table column; Field | Type | Null | Key | Default | Extra | column | i

RE: Looking for null values.

2004-10-04 Thread SGreen
ginal Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Monday, October 04, 2004 9:46 AM > To: Scott Hamm > Cc: [EMAIL PROTECTED] > Subject: Re: Looking for null values. > > > > Are you just looking for any column is null or that all columns are nul

RE: Looking for null values.

2004-10-04 Thread Scott Hamm
I'm trying to find a null value anywhere in QA table. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, October 04, 2004 9:46 AM To: Scott Hamm Cc: [EMAIL PROTECTED] Subject: Re: Looking for null values. Are you just looking for any column is nu

Re: Looking for null values.

2004-10-04 Thread SGreen
> How do I use SQL to look for null values in ANY column? > > SELECT * FROM QA WHERE * = null; > > > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] >

RE: Looking for null values.

2004-10-02 Thread Scott Hamm
1 AM > To: 'Scott Hamm'; [EMAIL PROTECTED] > Subject: RE: Looking for null values. > > I think you would have to do one column at a time. > > Like this. > > Select * from QA where title is NULL; > > Or you could get a little more crazy with something like

RE: Looking for null values.

2004-10-02 Thread Donny Simonton
nal Message- > From: Scott Hamm [mailto:[EMAIL PROTECTED] > Sent: Saturday, October 02, 2004 10:22 AM > To: [EMAIL PROTECTED] > Subject: Looking for null values. > > How do I use SQL to look for null values in ANY column? > > SELECT * FROM QA WHERE * = null; >

Looking for null values.

2004-10-02 Thread Scott Hamm
How do I use SQL to look for null values in ANY column? SELECT * FROM QA WHERE * = null; -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: NULL values

2004-08-04 Thread Whil Hentzen
> For certain columns i am completely sold on not using nulls, for others, i > cant see any conceptual reason to favor either way, so i thought i'd tap > you all for some insight. A NULL is the equivalent of saying "I don't know" whereas a 0 means the value between -1 and 1 and a blank means 'no

NULL values

2004-08-03 Thread sean c peters
HI all, i am tweaking some tables for an upgrade to MySQL 4.0.13 using InnoDB tables. I have a bunch of columns defaulted to NULL, and have been reading about using NULL's vs defined defaults, such as 0 or ''. I dont really have any need to differentiate between a blank and a null, so i am looki

Null values in a csv file and import to a mssql database

2004-06-08 Thread reto . breitenmoser
Hi I exported data from a mysql database to a csv file. Null values are exported as \N. When I import this csv file with the dts service from MSSql then I receive the following error when a null value (\N) is read: Error: -2147213268 (8004202C); Provider Error: 0 (0) Error string

Avg and Std function - null values

2004-03-22 Thread Pina Kelwin
Hi, (B (BI have a table with the sales of each product by month (in the format (Bmm). (BFor example: (table name: ventas) (B (Bsale_date prod_idsales (B200301 A20 (B200302 A16 (B200303 A18 (B200301 B12 (

Re: LIKE % not including NULL values?

2004-03-03 Thread Jonas Lindén
y not just do SELECT * FROM testdb ... The `%` will not match NULL values. >>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<< On 3/3/04, 9:41:22 AM, "Jonas Lindén" <[EMAIL

Re: LIKE % not including NULL values?

2004-03-03 Thread vpendleton
If you want all values why not just do SELECT * FROM testdb ... The `%` will not match NULL values. >>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<< On 3/3/04, 9:41:22 AM, "Jona

Re: LIKE % not including NULL values?

2004-03-03 Thread Egor Egorov
Jonas Lind?n <[EMAIL PROTECTED]> wrote: > SELECT * FROM testdb WHERE col1 LIKE '%' > > The above SELECT statement doesnt return columns with NULL values. Should it? ;). Yes. % matches any number of characters, NULL is not character string. Use IS NULL or IS NOT NULL oper

Re: LIKE % not including NULL values?

2004-03-03 Thread Bostjan Skufca (at) domenca.si
seems like gotcha :)) use: SELECT * FROM testdb WHERE col1 LIKE '%' OR col1 IS NULL; On Wednesday 03 of March 2004 16:41, Jonas Lindén wrote: > Hello list > > SELECT * FROM testdb WHERE col1 LIKE '%' > > The above SELECT statement doesnt return columns with NUL

LIKE % not including NULL values?

2004-03-03 Thread Jonas Lindén
Hello list SELECT * FROM testdb WHERE col1 LIKE '%' The above SELECT statement doesnt return columns with NULL values. Should it? ;). Should I approce the problem in another direction? Regards /Jonas

strange unique index behaviour on null values

2004-01-23 Thread mehdi
hi all, I have a very strange problem with some indexes. It is a unique index on a column containing null data. when I do a query like select * from xxx where yyy is null I get only one row (the first) but I know there is more. recentely, this table switched to innodb and we changed the server. I

Null Values & Foreign Keys

2004-01-06 Thread Randy Chrismon
Here're a couple of tables: create table company(CompanyID varchar(32),...); create table contact(CompanyId varchar(32),... INDEX (CompanyID), FOREIGN KEY (CompanyID) REFERENCES company(CompanyID); Now, my expectation is that if contact has a CompanyID but it does not match one already e

Re: Can't get LOAD DATA INFILE to put NULL values in columns for missing CSV values

2003-07-09 Thread Paul DuBois
ues. The table is defined to allow NULL's for these columns, and the default value for the columns is NULL. I can use "ABC",NULL,NULL,NULL to put in the null values into the table, but I'd prefer just to leave the field value empty, as in the example above. Otherwise I will h

Can't get LOAD DATA INFILE to put NULL values in columns for missing CSV values

2003-07-09 Thread mos
w NULL's for these columns, and the default value for the columns is NULL. I can use "ABC",NULL,NULL,NULL to put in the null values into the table, but I'd prefer just to leave the field value empty, as in the example above. Otherwise I will have to re-export all of the data.

re: Re: Null values set in tables

2003-03-15 Thread Egor Egorov
On Thursday 13 March 2003 20:27, Steve Holt wrote: > I am linking an MS Access front end to MYSQL on the back with ODBC > If I open the table I can enter a value in the course name field only which > is the primary key > and it will save the record even though I have not entered values in the > fie

Re: Null values set in tables

2003-03-14 Thread gerald_clark
imestamp(14) NOT NULL, PRIMARY KEY (`CourseName`), KEY `Specialty` (`Specialty`), KEY `BeginDate` (`BeginDate`) ) TYPE=MyISAM ROW_FORMAT=FIXED; Even with this description MYSQL allows me to create a new record with null values in the fields listed as not nul

Re: Null values set in tables

2003-03-13 Thread Steve Holt
, `fldTimestamp` timestamp(14) NOT NULL, PRIMARY KEY (`CourseName`), KEY `Specialty` (`Specialty`), KEY `BeginDate` (`BeginDate`) ) TYPE=MyISAM ROW_FORMAT=FIXED; Even with this description MYSQL allows me to create a new record with null values in the fields listed as not nul

Re: Null values set in tables

2003-03-12 Thread gerald_clark
pecialty` (`Specialty`), KEY `BeginDate` (`BeginDate`) ) TYPE=MyISAM ROW_FORMAT=FIXED; Even with this description MYSQL allows me to create a new record with null values in the fields listed as not null is there another setting somewhere I am missing?? Thanks Steve Holt

Null values set in tables

2003-03-12 Thread Steve Holt
BeginDate`) ) TYPE=MyISAM ROW_FORMAT=FIXED; Even with this description MYSQL allows me to create a new record with null values in the fields listed as not null is there another setting somewhere I am missing?? Thanks Steve Holt -

Re: Counting null values

2003-02-13 Thread Octavian Rasnita
would like to use: count(table_name.*) ... group by a_column_name ... but this won't work because this query not only that will give me that error, but I want to take the distinct values of the a_column_name only for non null values, and for null values I want to count them all thinking tha

Re: Counting null values

2003-02-12 Thread Paul DuBois
At 9:41 +0200 2/12/03, Octavian Rasnita wrote: It won't work because MySQL doesn't count null values. It depends. count(FieldName) will not count NULL values count(*) will, because it counts rows, not values. Teddy, Teddy's Center: http://teddy.fcc.ro/ Email: [

Re: Counting null values

2003-02-12 Thread Octavian Rasnita
It won't work because MySQL doesn't count null values. Teddy, Teddy's Center: http://teddy.fcc.ro/ Email: [EMAIL PROTECTED] - Original Message - From: "Daniel Kiss" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 11, 2003 8:18

Re: Counting null values

2003-02-10 Thread Daniel Kiss
result 5, meaning a distinct count for values which are not null, and counting all the null values. This means 1 for "abc", one for "xxx", and 3 for null values. Can you tell me what sql query should I use for counting this? Thank you. Teddy, Teddy's Center: http://te

Counting null values

2003-02-10 Thread Octavian Rasnita
Hi all, I have a table where I have something like this: | abc | | abc | | xxx | | null | | null | | null | I want to count these lines to give the result 5, meaning a distinct count for values which are not null, and counting all the null values. This means 1 for "abc", one for &q

re: Sorting with null values

2003-02-09 Thread Victoria Reznichenko
On Thursday 06 February 2003 17:05, Octavian Rasnita wrote: > Please tell me how can I sort a column and force placing the null values to > the end of list? Something like: SELECT ... ORDER BY IF(column_name IS NULL, 1, 0), column_name; -- For technical support contracts, goto

Re: Sorting with null values (auto)

2003-02-09 Thread mysql-list
s.html * http://www.mysql.com/doc/en/CREATE_TABLE.html * http://www.mysql.com/doc/en/Working_with_NULL.html * http://www.mysql.com/doc/en/Comparison_Operators.html This was an automated response to your email 'Sorting with null values'. Final search keyword used to quer

Sorting with null values

2003-02-07 Thread Octavian Rasnita
Hi all, Please tell me how can I sort a column and force placing the null values to the end of list? Thank you sql query Teddy, Teddy's Center: http://teddy.fcc.ro/ Email: [EMAIL PROTECTED] - Before posting, please

Re: Using Perl DBI quote() method with NULL values?

2003-01-08 Thread Salam Baker Shanawa
Hi Jeff, Try the magic undef as it is with no '' or "" $dbh->do('insert into yourtab values (' . join (',', map($dbh->quote($_), $your_stuff, undef, $more_stuff)) . ')') ; Regards Salam Jeff Snoxell wrote: Hello, I've got a mysql table with a lot of fields and I'm using a map

Re: Using Perl DBI quote() method with NULL values?

2003-01-07 Thread Rodney Broom
From: Jeff Snoxell <[EMAIL PROTECTED]> > ...I'm using a map statement... > ...through the quote system... Short answer: Don't do that. The longer answer: # Prepare the SQL using 'bind' operators. $sth = $MyDatabase->prepare(qq{ INSERT INTO MyTable (col1, col2, col3) VALUES

Re: Re: Using Perl DBI quote() method with NULL values?

2003-01-07 Thread Paul DuBois
Date: Wed, 8 Jan 2003 01:56:39 +0100 From: [EMAIL PROTECTED] To: Paul DuBois <[EMAIL PROTECTED]> Subject: Re: Re: Using Perl DBI quote() method with NULL values? At 17:16 -0500 1/7/03, walt wrote: Jeff, I'm not sure if this will help or not, but we ended up adding our own version

  1   2   >