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
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
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
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
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
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 <
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
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
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
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
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
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,
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?
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
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
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
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
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
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
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
> 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
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
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
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
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"
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
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 ''
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
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
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
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(
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),
> >
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
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 |
> 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:
;
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
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
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
> 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
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
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
/
-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
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
:[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
--+
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
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
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
> col1 col2col3
> >>> ---
> >>> NULLB1NULL
> >>> NULLNULLNULL
> >>> A3 B3 NULL
> >>> A4 NULLC4
> >>> A5 B5 C5
> >>> NULLB6 C6
> >&
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
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...
>
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?
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;
+---
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?
> > >
>
> > 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
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?
>
>
>
- 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
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
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
"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
>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;
[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)
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
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-
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
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
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
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
> 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]
>
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
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;
>
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]
> 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
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
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
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
(
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
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
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
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
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
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
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
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
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.
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
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
,
`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
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
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
-
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
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: [
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
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
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
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
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
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
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
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
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 - 100 of 154 matches
Mail list logo