Recreate the test table with a default that sets the column
to the empty string ( DEFAULT '' ). If you don't insert a value instead
of null you get ''. That will concatenate to give an empty string.


On 4/28/05, Paolo Vernazza <[EMAIL PROTECTED]> wrote:
> Hi,
> I've a table with some data...
> 
> CREATE table test (ID INTEGER PRIMARY KEY, a TEXT, b TEXT);
> INSERT INTO test (id, a, b) VALUES (1, "0356 bla bla bla", NULL);
> 
> I need to retrieve the string resulting from concatenating the a & b
> field...
> 
> I tried using the | operator, but it seems that concatenating a string
> and a NULL results in a NULL value..
> SELECT a | b FROM test WHERE ID=1;
> -> NULL
> 
> So I tried using coalesce (and ifnull), but it converts the string to a
> integer...
> SELECT colasce(a, '') | coalesce(b, '') WHERE ID=1;
> -> 356
> 
> Any idea about howto can I get the proper value?
> 
> Thanks
> 
> Paolo
> 


-- 
---
You a Gamer? If you're near Kansas City:
Conquest 36
https://events.reddawn.net

The Castles of Dereth Calendar: a tour of the art and architecture of
Asheron's Call
http://www.lulu.com/content/77264

Reply via email to