...
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 seems
- Original Message -
> From: "lejeczek"
> 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)NULLs in a list of give
- Original Message -
> From: "lejeczek"
> 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 it?
No, because NULL
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"
> 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, especially so with InnoDB. R
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 '
oduct 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:
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 is it? wi
no previous session for today) 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}'
%Y-%m-%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 retur
FORMAT(NOW() ,'%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 onl
e 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 the value even if user acttstoptime is null?
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 wrote:
Hi,
On 10/29/2013 9:52 PM, h
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 wrote:
> Hi,
>
> On 10/29/2013 9:52 PM, h...@tbbs.net wrote:
>
>> 2013/10/29
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)
<<<<<<<<
b
>>>> 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, FieldN
>>>> 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
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 mailto:shawn.l.gr...@oracle.com>&
nippet 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 databa
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 wrote:
> Hello Neil,
>
> On 10/28/2013 2:06 PM, Neil Tompkins wrote:
>
>> Hi
&
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 o
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
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
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-b
ing the current, broken state with the
>> functioning state (from backup) I discovered that in the broken version
>> there is this extra line in the information_schema.USER_PRIVILEGES table:
>>
>>| ''@'localhost' | NULL
ere
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 th
e:
| ''@'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 c
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
- Original Message -
> From: "David Lerer"
>
> 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 str
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
> Have you tried to set city = null (i.e. without the quotes)? David.
>
>
>
> -Original Mes
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
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 t
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
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
c" 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 ma
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(*) |
++--+
|
>>>> 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, N
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 o
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_eq
thank you, this makes sense.
On Thu, Jul 29, 2010 at 11:29 PM, Dan Nelson 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.0
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 |
&
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
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
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
1
www.the-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?
>
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 n
y, 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(1000,(7=7 or null is n
>-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] Interestin
Maybe:
WHERE coalesce(x, 17) = 17
""Jerry Schwartz"" 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)
>
>
>
> ?
>
>
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.
quot;Miao Jiang" 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
>
>
> --
> My
Take a look at SQL_MODE ;)
Claudio
On Jan 30, 2010 5:05 PM, "Miao Jiang" 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 y
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 u
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 IS NULL (has no data) or
> IS NOT NULL (has data) co
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 th
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 que
On Mon, Dec 28, 2009 at 5:41 PM, Carsten Pedersen wrote:
> David Giragosian skrev:
>
>> On Mon, Dec 28, 2009 at 2:32 PM, D. Dante Lorenso
>> wrote:
>>
>> Will anything ever be equal to NULL in a SELECT query?
>>>
>>
> ...
>
> What's s
David Giragosian skrev:
On Mon, Dec 28, 2009 at 2:32 PM, D. Dante Lorenso 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, Dante.
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
On Mon, Dec 28, 2009 at 2:32 PM, D. Dante Lorenso 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 so
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
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 recor
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:
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)
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
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>
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
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
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
ect
>> concat('pph',max(convert(substr(ppid,4),unsigned integer))) from
>> 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_it
er))) from 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
n 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
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 simi
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 si
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 regula
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 inp
, ' ', '''', rvf.filter_value,'''', ' ')
INTO
filterTMP
FROM
report_filters rvf
WHERE
rvf.report_id = RepID
AND rvf.report_column_id = colID;
IF filterTMP IS N
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 s
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
lumns 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
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
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 stat
s 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, n
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
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
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
re 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 the SQL)
> >
>
>
> SELECT IFNULL( SUM(AcctSessionTim
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&quo
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
''), '\n',
COALESCE(r.email,''))
FROM
registrants r,
addresses a
WHERE
r.reg_id=121
this is good. though, if r.title is NULL I'll get an extra empty row on
screen:
john doe
doe, inc.
<--
+
There are no result as you said.
- Original Message -
From: "Afan Pasalic" <[EMAIL PROTECTED]>
To: "ewen fortune" <[EMAIL PROTECTED]>
Cc:
Sent: Thursday, May 15, 2008 12:52 AM
Subject: Re: CONCAT doesn't work with NULL?
> actuall
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
records.
If query doesn't have concat() - it works fine.
Why is that?
That's how CONCAT() is documented to work:
http://dev.mysql.com/doc/refm
as sparator instead of '\n'
>
> :D
>
> ewen fortune wrote:
> > Hi Afan,
> > You can use concat_ws
> >
> > http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_con
> >cat-ws ---
> > CONCAT() returns NULL if any argument is
/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:
h
addresses a
WHERE
r.reg_id=121
Randall Price
Secure Enterprise Technology Initiatives
Microsoft Implementation Group
Virginia Tech Information Technology
1700 Pratt Drive
Blacksburg, VA 24060
-----Original Message-
From: Afan Pasalic [mailto:[EMAIL PROTECTED]
Sent: Wednesday,
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
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,
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 str
1 - 100 of 1048 matches
Mail list logo