...
Now - would searching, saving/storing then removing NULL vs ALLbutNULL
in a simple DB with one table wich has only primary key be sa
...
What is "removing NULL"? Deleting the record with NULL?
It has no bearing on the primary key, because NULL never is allowed in one.
It s
- Original Message -
> From: "lejeczek" <pelj...@yahoo.co.uk>
> Subject: Re: find any row with NULL
> ok, whereas that fist example was about all (and find
> columns' names without knowing) columns - would there be a
> simple(r) syntax to find that (not)NU
- Original Message -
> From: "lejeczek" <pelj...@yahoo.co.uk>
> Subject: Re: find any row with NULL
>
> shame NULL won't work as in:
> > select user_id,completetion_time from depression where
> NULL in(email_me, other_diagnosis);
> or does i
On 09/07/16 14:13, Hal.sz S.ndor wrote:
2016/07/08 09:15 ... Johan De Meersman:
You will have to repeat all the column names - no
wildcards in where clause fieldnames - but the clause
you're looking for is WHERE field IS NULL. Or IS NOT NULL
if you want those:-)
Well, one could try
- Original Message -
> From: "Sándor Halász" <h...@tbbs.net>
> Subject: Re: find any row with NULL
>
> from information_schema.columns where (table_schema, table_name,
You could, but information_schema queries can get pretty slow on large
databases, espec
2016/07/08 09:15 ... Johan De Meersman:
You will have to repeat all the column names - no wildcards in where clause
fieldnames - but the clause you're looking for is WHERE field IS NULL. Or IS
NOT NULL if you want those:-)
Well, one could try this:
set @sel=(select 'SELECT ' || GROUP_CONCAT
is
not in stock' (count = 0) and 'I have not counted this product
yet' (count IS NULL).
Excellent example
-bill
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql
You will have to repeat all the column names - no wildcards in where clause
fieldnames - but the clause you're looking for is WHERE field IS NULL. Or IS
NOT NULL if you want those :-)
Remember, NULL is a special value that is not the same as zero or the empty
string; nor to itself: NULL
hi there,
I've been searching the vastness of the net but cannot find
- how - to get all the rows with a NULL.
And like any novice I wonder if this can be done without
reiterating all the columns names(not manually at least)?
Some expert would say it is easy, how easy
) it
returns NULL.
So how can i can get the value even if user acttstoptime is null?
Try this...(using an earlier suggestion to the thread)
SELECT
SUM(acctinputoctets + acctoutputoctets) AS Total
FROM radacct
WHERE
radacct.username='%{User-Name}'
AND acctstarttime BETWEEN CURDATE
-%d') AND NOW() AND
acctstoptime between DATE_FORMAT(NOW() ,'%Y-%m-%d') AND NOW()) AND
radacct.username='%{User-Name}'
It works fine if there is acctstoptime value in table. but if user have not
disconnected yet (and have no previous session for today) it returns NULL.
So how can i can get
() ,'%Y-%m-%d') AND NOW()) AND
username='%{User-Name}'
It works fine if there is acctstoptime value in table. but if user have not
disconnected yet (and have no previous session for today) it returns NULL.
That expression has problems. Not only it works only when both
acctstarttime
DATE_FORMAT(NOW() ,'%Y-%m-%d') AND NOW()) AND
radacct.username='%{User-Name}'
It works fine if there is acctstoptime value in table. but if user have not
disconnected yet (and have no previous session for today) it returns NULL.
So how can i can get the value even if user acttstoptime is null?
Shawn
What I need is that if I pass say 10 parameters/variables to a query, I
only want to update the column/field if the value passed is NOT NULL.
On Wed, Oct 30, 2013 at 3:41 AM, Shawn Green shawn.l.gr...@oracle.comwrote:
Hi,
On 10/29/2013 9:52 PM, h...@tbbs.net wrote:
2013/10/29 11:35
Hi Neil,
On 10/30/2013 9:55 AM, Neil Tompkins wrote:
Shawn
What I need is that if I pass say 10 parameters/variables to a query, I
only want to update the column/field if the value passed is NOT NULL.
On Wed, Oct 30, 2013 at 3:41 AM, Shawn Green shawn.l.gr...@oracle.comwrote:
Hi,
On 10
of the UPDATE statement I provided shows updating only 1 field.
However in my live working example, I have about 20 possible fields that
might need to be updated if the variable passed for each field is NOT
NULL.
Therefore, I felt this needs to be done at database level in the stored
procedure. How
that might need to be updated if the variable
passed for each field is NOT NULL.
Therefore, I felt this needs to be done at database level in the stored
procedure. How can I accomplish this.
Thanks
Neil
On Mon, Oct 28, 2013 at 6:17 PM, Shawn Green shawn.l.gr...@oracle.com
mailto:shawn.l.gr
2013/10/28 21:23 +, Neil Tompkins
Basically the snippet of the UPDATE statement I provided shows updating only 1
field.
However in my live working example, I have about 20 possible fields that
might need to be updated if the variable passed for each field is NOT NULL.
Well, maybe
2013/10/29 11:35 -0400, Shawn Green
My favorite technique is the COALESCE function for this on a column-by-column
basis
SET FieldName1 = Now(), FieldName2 = COALESCE(:MyVariable, FieldName2)
but if MyVariable is NULL, FieldName1 reflects the attempt to change, not
change.
--
MySQL
Hi,
On 10/29/2013 9:52 PM, h...@tbbs.net wrote:
2013/10/29 11:35 -0400, Shawn Green
My favorite technique is the COALESCE function for this on a column-by-column
basis
SET FieldName1 = Now(), FieldName2 = COALESCE(:MyVariable, FieldName2)
but if MyVariable is NULL, FieldName1 reflects
Hi
If I have a update statement like
UPDATE MY_TABLE
SET FieldName1 = Now(), FieldName2 = :MyVariable
WHERE FieldName3 = 'Y'
How can I only update the FieldName2 field if the value of MyVariable is
NOT NULL ?
Thanks
Neil
Try:
update my_table
set fieldname1 = Now(), Fieldname2 = :myVariable
where Fieldname3 is not null
On 10/28/13 11:06 AM, Neil Tompkins wrote:
Hi
If I have a update statement like
UPDATE MY_TABLE
SET FieldName1 = Now(), FieldName2 = :MyVariable
WHERE FieldName3 = 'Y'
How can I only update
Hello Neil,
On 10/28/2013 2:06 PM, Neil Tompkins wrote:
Hi
If I have a update statement like
UPDATE MY_TABLE
SET FieldName1 = Now(), FieldName2 = :MyVariable
WHERE FieldName3 = 'Y'
How can I only update the FieldName2 field if the value of MyVariable is
NOT NULL ?
Thanks
Neil
This needs
is NOT
NULL.
Therefore, I felt this needs to be done at database level in the stored
procedure. How can I accomplish this.
Thanks
Neil
On Mon, Oct 28, 2013 at 6:17 PM, Shawn Green shawn.l.gr...@oracle.comwrote:
Hello Neil,
On 10/28/2013 2:06 PM, Neil Tompkins wrote:
Hi
If I have
version there
is this extra line in the information_schema.USER_PRIVILEGES table:
| ''@'localhost' | NULL | USAGE
| NO |
(Note the null-string user prepended to @localhost)
Again: the functional, non-broken state does NOT have
in the information_schema.USER_PRIVILEGES table:
| ''@'localhost' | NULL | USAGE
| NO |
(Note the null-string user prepended to @localhost)
Again: the functional, non-broken state does NOT have this entry. Thus, my
current theory is that this line
' | NULL | USAGE
| NO |
(Note the null-string user prepended to @localhost)
Again: the functional, non-broken state does NOT have this entry. Thus, my
current theory is that this line is the culprit. Prior to the failure I had a
surge of experimental
in the information_schema.USER_PRIVILEGES table:
| ''@'localhost' | NULL | USAGE
| NO |
(Note the null-string user prepended to @localhost)
Again: the functional, non-broken state does NOT have this entry. Thus, my
current theory is that this line is the culprit
This is, maybe, a question of taste. I find it useful in the aggregate
functions that they ignore all NULLs that come under their purview, but yield
NULL if nothing else comes. Now, CONCAT_WS is no aggregate function, but is
like them in that it ignores all NULLs that come its way, aside from
When I do the following query:
SELECT * FROM geo_trivia WHERE city IS NULL;
certain columns that DO have 'NULL' value for city and not a '' (blank)
value do not show up.
I have even gone to the extent of reseting these records value as ='NULL'
with UPDATE and they are still are not selected
Have you tried to set city = null (i.e. without the quotes)? David.
-Original Message-
From: Richard Reina [mailto:gatorre...@gmail.com]
Sent: Friday, March 09, 2012 4:24 PM
To: mysql@lists.mysql.com
Subject: query problem with null
When I do the following query:
SELECT * FROM
Ahhh... Thank you, that was exactly what the problem was. I will fix the
code that is setting the value of these new records to 'NULL'.
Thank you.
2012/3/9 David Lerer dle...@us.univision.com
Have you tried to set city = null (i.e. without the quotes)? David.
-Original Message
- Original Message -
From: David Lerer dle...@us.univision.com
Have you tried to set city = null (i.e. without the quotes)?
Spot on, I'd think.
NULL values are not a string with NULL in it - that's only what it looks like
in query results :-) An empty string ('') is to strings
Hi,
If I use NULL UNIQUE when I create a table, it seems that only one
NULL entry is allowed. Since NULL could mean unknown, in this case,
two unknowns are not the same and I want to allow multiple nulls but I
still want non null entries be unique. Is there a construct in mysql
that can create
Hi,
On 17-10-2011 15:39, Peng Yu wrote:
If I use NULL UNIQUE when I create a table, it seems that only one
NULL entry is allowed. Since NULL could mean unknown, in this case,
two unknowns are not the same and I want to allow multiple nulls but I
still want non null entries be unique
Hello,
I have a problem with the following query:
SELECT subject_identifier, COUNT(*) FROM asr_sentence_score WHERE
total_words = correct_words GROUP BY subject_identifier;
OutPut:
++--+
| subject_identifier | COUNT(*) |
++--+
|
is the name given COUNT(*) in the query with COUNT(*).
This yields at least one row for every one in table-of-identifiers, whether
there is a match in query with COUNT or not; if not, c is NULL, and with
IFNULL that NULL is made 0.
You write test-taker, but for a field that could be the foregoing
2011/10/02 15:01 +0200, Jigal van Hemert
You are not using NULL as the original concept of it was. NULL means that the
value is undefined or unknown.
That is quite true, especially in a table. But, almost from the beginning, NULL
was overloaded:
set @m = (select sins from emailinglist where
Hi,
On 1-10-2011 21:51, Halász Sándor wrote:
It is, of course, generally considered more natural to make equality
primary, not inequality, but that symbol that MySQL uses for
NULL-safe equality,=, looks much more like inequality than
equality.
The whole concept and the name of this operator
It is, of course, generally considered more natural to make equality primary,
not inequality, but that symbol that MySQL uses for NULL-safe equality, =,
looks much more like inequality than equality. Furthermore, I find that in my
code I am far oftener interested in NULL-safe _in_equality than
Hello,
I don't know what I am missing, but I have this:
mysql SELECT url FROM product WHERE url IS NULL;
Empty set (0.05 sec)
mysql SELECT url FROM product WHERE product_Id = 67;
+--+
| url |
+--+
| |
+--+
1 row in set (0.00 sec)
what goes with this, how can i ensure
blank is not null... I'll bet if you did
SELECT url FROM product WHERE url = '';
you'll get a row or three. If the field was NULL, your product_id
select would look like:
+--+
| url |
+--+
|NULL |
+--+
andy
Norman Khine wrote:
Hello,
I don't know what I am missing, but I
In the last episode (Jul 29), Norman Khine said:
I don't know what I am missing, but I have this:
mysql SELECT url FROM product WHERE url IS NULL;
Empty set (0.05 sec)
mysql SELECT url FROM product WHERE product_Id = 67;
+--+
| url |
+--+
| |
+--+
1 row in set (0.00
thank you, this makes sense.
On Thu, Jul 29, 2010 at 11:29 PM, Dan Nelson dnel...@allantgroup.com wrote:
In the last episode (Jul 29), Norman Khine said:
I don't know what I am missing, but I have this:
mysql SELECT url FROM product WHERE url IS NULL;
Empty set (0.05 sec)
mysql SELECT url
-infoshop.com
-Original Message-
From: João Cândido de Souza Neto [mailto:j...@consultorweb.cnt.br]
Sent: Wednesday, March 10, 2010 2:10 PM
To: mysql@lists.mysql.com
Subject: Re: Particular value or NULL
Did you gave a try on using coalesce in your query?
Jerry Schwartz jschwa...@the-infoshop.com
Hi Jerry, all!
Jerry Schwartz wrote:
[[...]]
Maybe:
WHERE coalesce(x, 17) = 17
[JS] Interesting suggestion, but
us-gii select benchmark(1000,(7=7 or null is null));
[[...]]
1 row in set (0.34 sec)
us-gii select benchmark(1,coalesce(null,7));
[[...]]
1 row in set
Is there a better construct for the WHERE clause in a LEFT JOIN than
WHERE (x = 17 OR x IS NULL)
?
Regards,
Jerry Schwartz
The Infoshop by Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032
860.674.8796 / FAX: 860.674.8341
http://www.the
Maybe:
WHERE coalesce(x, 17) = 17
Jerry Schwartz jschwa...@the-infoshop.com escreveu na mensagem
news:023301cac069$366afa00$a340ee...@com...
Is there a better construct for the WHERE clause in a LEFT JOIN than
WHERE (x = 17 OR x IS NULL)
?
Regards,
Jerry Schwartz
-Original Message-
From: João Cândido de Souza Neto [mailto:j...@consultorweb.cnt.br]
Sent: Wednesday, March 10, 2010 10:55 AM
To: mysql@lists.mysql.com
Subject: Re: Particular value or NULL
Maybe:
WHERE coalesce(x, 17) = 17
[JS] Interesting suggestion, but
us-gii select benchmark
To: mysql@lists.mysql.com
Subject: Re: Particular value or NULL
Maybe:
WHERE coalesce(x, 17) = 17
[JS] Interesting suggestion, but
us-gii select benchmark(1000,(7=7 or null is null));
+---+
| benchmark(1000,(7=7 or null is null
Maybe:
WHERE coalesce(x, 17) = 17
[JS] Interesting suggestion, but
us-gii select benchmark(1000,(7=7 or null is null));
+---+
| benchmark(1000,(7=7 or null is null
When I try insert NULL to VARCHAR NOT NULL column, It will shows a
warning and convert NULL to '' then insert 。
I want to MySQL raise an exception when I try do that.
How to do that?
Thank you.
Miao
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe
Take a look at SQL_MODE ;)
Claudio
On Jan 30, 2010 5:05 PM, Miao Jiang jiangfri...@gmail.com wrote:
When I try insert NULL to VARCHAR NOT NULL column, It will shows a warning
and convert NULL to '' then insert 。
I want to MySQL raise an exception when I try do that.
How to do that?
Thank you
Jiang jiangfri...@gmail.com wrote:
When I try insert NULL to VARCHAR NOT NULL column, It will shows a warning
and convert NULL to '' then insert 。
I want to MySQL raise an exception when I try do that.
How to do that?
Thank you.
Miao
--
MySQL General Mailing List
For list archives: http
Martijn,
thanks for your excellent mail:
Martijn Tonies wrote:
[[...]]
A column can have two states: null or not null. It either has
data (a value, depending on the datatype), or no data (null),
which is where column IS NULL (has no data) or
column IS NOT NULL (has data) comes into play
Will anything ever be equal to NULL in a SELECT query?
SELECT *
FROM sometable
WHERE somecolumn = NULL;
I have a real-life query like this:
SELECT *
FROM sometable
WHERE somecolumn = NULL OR somecolumn = 'abc';
The 'sometable' contains about 40 million records and in this query
No, nothing will ever equal null. In strict relational theory, which I
don't know well enough to begin expounding on here, null does not even
equal another null. That's why SQL provides IS NULL and IS NOT NULL
as explicit cases.
- michael dykman
On Mon, Dec 28, 2009 at 2:32 PM, D. Dante
On Mon, Dec 28, 2009 at 2:32 PM, D. Dante Lorenso da...@lorenso.com wrote:
Will anything ever be equal to NULL in a SELECT query?
SELECT *
FROM sometable
WHERE somecolumn = NULL;
I have a real-life query like this:
SELECT *
FROM sometable
WHERE somecolumn = NULL OR somecolumn
Hi,
Will anything ever be equal to NULL in a SELECT query?
No, never.
Null also means unknown, if you design your tables well enough,
there should be no NULLs -stored- (different from a resultset,
where there can be nulls, for example in LEFT JOINs), because
it's no use to store what you
David Giragosian skrev:
On Mon, Dec 28, 2009 at 2:32 PM, D. Dante Lorenso da...@lorenso.com wrote:
Will anything ever be equal to NULL in a SELECT query?
...
What's so special about NULL?
http://dev.mysql.com/doc/refman/5.0/en/working-with-null.html
Should answer some of your questions
On Mon, Dec 28, 2009 at 5:41 PM, Carsten Pedersen cars...@bitbybit.dkwrote:
David Giragosian skrev:
On Mon, Dec 28, 2009 at 2:32 PM, D. Dante Lorenso da...@lorenso.com
wrote:
Will anything ever be equal to NULL in a SELECT query?
...
What's so special about NULL?
http
Well, if nothing can ever equal null, then why isn't MySQL query parser
smart enough to reduce my queries to something more sensible? If I'm
saying this:
SELECT *
FROM sometable
WHERE somecolumn = NULL OR somecolumn = 'abc';
Why isn't it able to reduce the query to something more like
Well, if nothing can ever equal null, then why isn't MySQL query parser
smart enough to reduce my queries to something more sensible? If I'm
saying this:
SELECT *
FROM sometable
WHERE somecolumn = NULL OR somecolumn = 'abc';
Why isn't it able to reduce the query to something more
It's often said that NOT NULL column is preferable in terms of index
performance.
I was wondering exactly why and how this is so specifically to InnoDB.
It would be great if someone can shed light on this matter in some detail.
Kyong
--
MySQL General Mailing List
For list archives: http
Hi,
I have a table with a column like:
date date default null,
If I enter an empty string in it, the default null value is added (as it
should).
But if I enter an invalid date by mistake, the date -00-00 date date is
entered instead of the default null, and this is not good.
Can I do
Hi Octavian,
One approach is to use a trigger,
mysql set sql_mode = '';
mysql create table temp_date(d date default null);
mysql create trigger temp_date_bi before insert on temp_date for each row set
new.d = if(new.d = '-00-00', null, new.d);
mysql insert into temp_date(d) values('2009
Hi,
I have a table with a column like:
date date default null,
If I enter an empty string in it, the default null value is added (as it
should).
But if I enter an invalid date by mistake, the date -00-00 date date
is entered instead of the default null, and this is not good.
Can I
Agreed. And don't forget to listen to the warnings MySQL sends back,
e.g.:
mysql create table temp_date(d date default null);
Query OK, 0 rows affected (0.15 sec)
mysql insert into temp_date(d) values('2009-13-99');
Query OK, 1 row affected, 1 warning (0.00 sec)
mysql show warnings
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 archives: http
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 19:54
hello,
assume the following table:
CREATE TABLE t (
id INT UNSIGNED auto_increment PRIMARY KEY,
c1 INT UNSIGNED NOT NULL,
c2 INT UNSIGNED NOT NULL,
c3 INT UNSIGNED,
UNIQUE (c1, c2, c3)
) engine = InnoDB;
Our first issue is that the UNIQUE constraint on (c1,c2,c3) does not
work in the case
convertion(p_unit,v_bhunit,p_item,p_size,p_quantity,v_conqty);
set v_calqty=v_conqty*v_blqty;
if v_puid is not null then
set v_mess='max id is exists';
else
insert into prplrawm(ppid,plid,item,szid,rawm,rqty,runt)
values(p_autoincrement,v_plid,p_item,p_size,v_blrawm,v_blrqty,v_blrunt);
set
prpllins);
open c_bomdet;
repeat
fetch c_bomdet into v_bhqty,v_bhunit,v_blrawm,v_blqty,v_blunit;
if not done then
call convertion(p_unit,v_bhunit,p_item,p_size,p_quantity,v_conqty);
set v_calqty=v_conqty*v_blqty;
if v_puid is not null then
set v_mess='max id is exists';
else
insert into prplrawm
;
repeat
fetch c_bomdet into v_bhqty,v_bhunit,v_blrawm,v_blqty,v_blunit;
if not done then
call convertion(p_unit,v_bhunit,p_item,p_size,p_quantity,v_conqty);
set v_calqty=v_conqty*v_blqty;
if v_puid is not null then
set v_mess='max id is exists';
else
insert into prplrawm(ppid,plid,item,szid
In SQL, the correct syntax is IS NULL or IS NOT NULL.
Random programming languages more often than not have no decent support for
NULL content, although your DB library might have an isnull() function or
something similar. Once you've exported a field into a regular variable,
however, most often
Hi !
Johan De Meersman wrote:
In SQL, the correct syntax is IS NULL or IS NOT NULL.
Random programming languages more often than not have no decent support for
NULL content, although your DB library might have an isnull() function or
something similar. Once you've exported a field
Johan De Meersman wrote:
In SQL, the correct syntax is IS NULL or IS NOT NULL.
Random programming languages more often than not have no decent
support for
NULL content, although your DB library might have an isnull() function or
something similar. Once you've exported a field into a regular
I know this is not working, but how can I check for NULL; or how can I
configure my field sub_title so I can check if $booksub_title contains
anything or is empty.
This problem as been breaking my back...don't know what to put in as a
default to be able to check against string input (VARCHAR
Below I have a function with a cursor. I have tested the cursor sql
manually and it is fine, I have put the variables into the sql inside
the cursor loop and it returns data too, BUT, executing this function
returns null even though I know the correct info is available. Am I
missing something
OK, I know WHY it is returning null, just not WHAT to do about it.
In the inside sql, there is not always a result. So, done becomes 1 and
the repeat exits.
How can I keep from this happening? How could I make another 'done' like
variable that would not get also set to 1 if the inner sql doesn't
report_filters rvf
WHERE
rvf.report_id = RepID
AND rvf.report_column_id = colID;
IF filterTMP IS NOT NULL THEN
IF filterSQL IS NULL THEN
SELECT
filterTMP
INTO
filterSQL;
ELSE
should probably be records with a column indicating what
type of data it is.
Brent Baisley
On Sep 4, 2008, at 5:11 AM, drflxms wrote:
Dear MySQL specialists,
this is a MySQL-newbie question: I want to create a view of a table,
where all NULL-values are substituted by 0. Therefore I tried
Dear MySQL specialists,
this is a MySQL-newbie question: I want to create a view of a table,
where all NULL-values are substituted by 0. Therefore I tried:
SELECT *,
IFNULL(*,0)
FROM table
Unfortunately IFNULL seems not to accept any wildcards like * as
placeholder for the column-name. REGEXP
Hi,
OS - Solaris 10, 32 Gb RAM, mysql 64-bit 4.1.22
Every day I see in processlist many SELECT queries that stay in NULL state for a
long time. Something Like this
| 368966 | radius | fire-u1:35671 | srg_conf | Query | 106 | NULL
|SELECT id, deleted_id, status, name
64-bit 4.1.22
Every day I see in processlist many SELECT queries that stay in NULL state
for a long time. Something Like this
| 368966 | radius | fire-u1:35671 | srg_conf | Query | 106 |
NULL |SELECT id, deleted_id, status, name, LEFT( value, 1000 )
FROM s
| 368967
and Sender
does not endorse distribution to any party other than intended recipient.
Sender does not necessarily endorse content contained within this transmission.
Date: Thu, 14 Aug 2008 17:35:00 +0530 From: [EMAIL PROTECTED] To: [EMAIL
PROTECTED] Subject: Re: SELECT in NULL state for a long time CC
Hello,
I do not understand the behavior of a simple table :
from what I red, in the following exemple the Null column tells the value
can be set to NULL, and the Default value is NULL.
It doesn't seem to work that way.
Some one could explain it ?
I run on a linux debian/etch 5.0.32 MySQL
in your data file use this for inserting null values '\N'
0.12345;qwer
1.2345;\N
\N;asdf
On 7/17/08, Gilles MISSONNIER [EMAIL PROTECTED] wrote:
Hello,
I do not understand the behavior of a simple table :
from what I red, in the following exemple the Null column tells the value
can be set
Hi,
I'm running a query :
SELECT SUM(AcctSessionTime) FROM radacct WHERE UserName='hotspot';
But if there aren't any rows in radacct for the UserName of
hotspot, it returns a NULL. Is there a way to change it to return 0
instead? (I can't change the application, but I can change
On Fri, May 23, 2008 at 8:23 AM, Tuc at T-B-O-H.NET [EMAIL PROTECTED] wrote:
Hi,
I'm running a query :
SELECT SUM(AcctSessionTime) FROM radacct WHERE UserName='hotspot';
But if there aren't any rows in radacct for the UserName of
hotspot, it returns a NULL. Is there a way
On Fri, May 23, 2008 at 8:23 AM, Tuc at T-B-O-H.NET [EMAIL PROTECTED] wrote:
Hi,
I'm running a query :
SELECT SUM(AcctSessionTime) FROM radacct WHERE UserName='hotspot';
But if there aren't any rows in radacct for the UserName of
hotspot, it returns a NULL
this is good. though, if r.title is NULL I'll get an extra empty row on
screen:
john doe
doe, inc.
-- no title, empty row
123 main st.
testtown, TE 12345
also, I would like to hear opinion about the following query:
SELECT o.col1, o.col2, o.col3,
(
SELECT CONCAT_WS
hi,
I have query
SELECT CONCAT(r.first_name, ' ', r.last_name, '\n', r.organization,
'\n', r.title, '\n', a.address1, '\n', a.city, ', ', a.state, ' ',
a.zip, '\n', r.email)
FROM registrants r, addresses a
WHERE r.reg_id=121
if any of columns has value (e.g. title) NULL, I'll get as result 0
It doesn't return no rows, it returns row(s) with a single column set to a
NULL value. In case one of the arguments is NULL, CONCAT() will return NULL.
To replace the value of one of the fields with an empty string when it's
NULL, you can use something like: CONCAT(COAESCE(a, ''), ' ', COAESCE(b
Hi Afan,
You can use concat_ws
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_concat-ws
---
CONCAT() returns NULL if any argument is NULL.
CONCAT_WS() does not skip empty strings. However, it does skip any
NULL values after the separator argument
---
Ewen
On Wed, May 14
On Wednesday 14 May 2008 18:02:42 Olexandr Melnyk wrote:
It doesn't return no rows, it returns row(s) with a single column set to a
NULL value. In case one of the arguments is NULL, CONCAT() will return
NULL.
To replace the value of one of the fields with an empty string when it's
NULL, you
work with NULL?
hi,
I have query
SELECT CONCAT(r.first_name, ' ', r.last_name, '\n', r.organization,
'\n', r.title, '\n', a.address1, '\n', a.city, ', ', a.state, ' ',
a.zip, '\n', r.email)
FROM registrants r, addresses a
WHERE r.reg_id=121
if any of columns has value (e.g. title) NULL, I'll get
Thanks Ewen,
that's what I was looking for!
:D
-afan
ewen fortune wrote:
Hi Afan,
You can use concat_ws
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_concat-ws
---
CONCAT() returns NULL if any argument is NULL.
CONCAT_WS() does not skip empty strings. However, it does
Pratt Drive
Blacksburg, VA 24060
-Original Message-
From: Afan Pasalic [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 14, 2008 11:53 AM
To: mysql@lists.mysql.com
Subject: CONCAT doesn't work with NULL?
hi,
I have query
SELECT CONCAT(r.first_name, ' ', r.last_name, '\n', r.organization
/5.0/en/string-functions.html#function_concat-ws
---
CONCAT() returns NULL if any argument is NULL.
CONCAT_WS() does not skip empty strings. However, it does skip any
NULL values after the separator argument
---
Ewen
On Wed, May 14, 2008 at 5:53 PM, Afan Pasalic [EMAIL PROTECTED] wrote:
hi,
I
1 - 100 of 1025 matches
Mail list logo