Re: Using @ variables with LIKE,CONCAT

2011-05-11 Thread Richard Bensley
Hi, I just tried this on a schema I had laying about and it worked fine: mysql> SET @dude='pilgrim'; Query OK, 0 rows affected (0.00 sec) mysql> SELECT namefield FROM mytable WHERE namefield LIKE CONCAT('%',@dude,'%'); +---

Using @ variables with LIKE,CONCAT

2011-05-11 Thread Hank
This used to work fine in Mysql 4.3, but no longer works in 5.5.8: set @txt='needle'; select * from table where field like CONCAT('%',@txt,'%'); --returns the null set. If I substitute like this: select * from table where field like '%needle%';

RE: CONCAT with IF?

2009-07-08 Thread Gavin Towey
om: Matt Neimeyer [mailto:m...@neimeyer.org] Sent: Wednesday, July 08, 2009 2:45 PM To: mysql@lists.mysql.com Subject: CONCAT with IF? I want to store the product version that an article applies to and a comparison operator in my news system. But I can't wrap my head around the where clause...

CONCAT with IF?

2009-07-08 Thread Matt Neimeyer
I want to store the product version that an article applies to and a comparison operator in my news system. But I can't wrap my head around the where clause... Here's what I've tried... CREATE TABLE test (version char(10), direction char(2)); select concat("6.0",direct

Re: left joins & concat

2009-02-22 Thread PJ
S (heh... heh... heh ;-) : >> >> "SELECT b.title, b.sub_title, b.descr, b.comment, b.bk_cover, >> b.copyright, b.ISBN, c.publisher, >> CONCAT_WS(' ', first_name, last_name) AS Author >> FROM book AS b >> LEFT JOIN book_author AS ab ON b.id = ab.bookID &g

Re: left joins & concat

2009-02-22 Thread Walter Heck
ab ON b.id = ab.bookID > LEFT JOIN author AS a ON ab.authID=a.id > LEFT JOIN book_publisher AS abc ON b.id = abc.bookID > LEFT JOIN publishers AS c ON abc.publishers_id = c.id > ORDER BY title ASC " > > This works except I don't fully understand how the CONCAT AS Aut

Re: left joins & concat

2009-02-22 Thread PJ
C " This works except I don't fully understand how the CONCAT AS Author works, nor the AS ab and AS abc. Does the order of ab and abc matter? Are they related... I think I got this working by pure experimentation in trying all possible combinations... kind of primitive, but it seems

Re: left joins & concat

2009-02-22 Thread PJ
ions > is also knows as FOREIGN KEY, in this case the left operand) > > The resulting table is a table that have each row like a concatenation > of two rows related from the two different tables. > > The WHERE clause is used to FILTER, not to connect the two tables!! > After you co

Re: left joins & concat

2009-02-22 Thread Claudio Nanni
o see only certain rows, ok now you use the WHERE. Forget about CONCAT/CONCAT_WS this is a string function, and is not related to JOINS. Please, let me know if this was useful to you. Claudio Nanni 2009/2/22 PJ > I have been searching and searching for a clear and logical explanation &

left joins & concat

2009-02-21 Thread PJ
I have been searching and searching for a clear and logical explanation of JOINs and have found nothing that can be reasonably understood. Perhaps I am dense or from another planet, but nothing seems to fall into place. I need to display all the books (with their respective authors and publishers)

Re: CONCAT doesn't work with NULL?

2008-05-21 Thread Afan Pasalic
Price, Randall wrote: Could you use something like this (untried): SELECT CONCAT(COALESCE(r.first_name, ''), ' ', COALESCE(r.last_name,''), '\n', COALESCE(r.organization, ''), '\n',

Re: CONCAT doesn't work with NULL?

2008-05-14 Thread 王旭
+ 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

Re: CONCAT doesn't work with NULL?

2008-05-14 Thread Paul DuBois
On May 14, 2008, at 10:53 AM, Afan Pasalic wrote: 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, '\

Re: CONCAT doesn't work with NULL?

2008-05-14 Thread wim . delvaux
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

Re: CONCAT doesn't work with NULL?

2008-05-14 Thread Afan Pasalic
/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

Re: CONCAT doesn't work with NULL?

2008-05-14 Thread Afan Pasalic
First, I want to thank to everybody on such afast respond. Thank you. Second, what would be difference between concat_ws and the Randalll's solution (bellow)? -afan Price, Randall wrote: Could you use something like this (untried): SELECT CONCAT(COALESCE(r.first

Re: CONCAT doesn't work with NULL?

2008-05-14 Thread Afan Pasalic
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

RE: CONCAT doesn't work with NULL?

2008-05-14 Thread Price, Randall
Could you use something like this (untried): SELECT CONCAT(COALESCE(r.first_name, ''), ' ', COALESCE(r.last_name,''), '\n', COALESCE(r.organization, ''), '\n', COALESCE(r.title,

Re: CONCAT doesn't work with NULL?

2008-05-14 Thread wim . delvaux
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

Re: CONCAT doesn't work with NULL?

2008-05-14 Thread ewen fortune
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

Re: CONCAT doesn't work with NULL?

2008-05-14 Thread Olexandr Melnyk
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, '&#x

CONCAT doesn't work with NULL?

2008-05-14 Thread Afan Pasalic
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

Re: Concat alternative

2007-10-26 Thread Gerard
On 10/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Gerard wrote: > > Currently I am running a concat statement to combine a field with a user > > name and domain to create and email address. In testing it looks like > > running the concat is a very s

Re: Concat alternative

2007-10-24 Thread mysql
Gerard wrote: Currently I am running a concat statement to combine a field with a user name and domain to create and email address. In testing it looks like running the concat is a very slow command to run. The select statement currently looks like this. select concat(user,'@&#x

Re: Concat alternative

2007-10-24 Thread Rob Wultsch
On 10/24/07, Gerard <[EMAIL PROTECTED]> wrote: > Currently I am running a concat statement to combine a field with a user > name and domain to create and email address. In testing it looks like > running the concat is a very slow command to run. The select statement > current

Concat alternative

2007-10-24 Thread Gerard
Currently I am running a concat statement to combine a field with a user name and domain to create and email address. In testing it looks like running the concat is a very slow command to run. The select statement currently looks like this. select concat(user,'@',domain),servername

Re: CONCAT(int_col, string_col) and charset and collation problems

2007-02-01 Thread ViSolve DB Team
ot an expr. I just wonder why CONCAT(1, ',', Name) works OK even if CHARSET(1) is binary string and CONCAT(id, ',', Name) doesn't It does. mysql> select concat(1,',',tt) from test; +--+ | concat(1,',',tt) | +

Re: CONCAT(int_col, string_col) and charset and collation problems

2007-02-01 Thread Dušan Pavlica
I know about CONVERT but I wanted to check character set of 'tt' column and this result use in CONVERT. Something like CONVERT(id USING CHARSET(Name)) which doesn't work. I just wonder why CONCAT(1, ',', Name) works OK even if CHARSET(1) is binary string and CONC

Re: CONCAT(int_col, string_col) and charset and collation problems

2007-02-01 Thread ViSolve DB Team
Hi, It is that, what you think a binary is ,...is indeed a binary. As per the manual, If a string input or function result is a binary string, the string has no character set or collation. so the resultant 'binary' is expected. if u want the resultant as: mysql> select char

CONCAT(int_col, string_col) and charset and collation problems

2007-01-31 Thread Dušan Pavlica
Hi, I'm using MySQL 4.1.15, WinXP and my problem is that SELECT CHARSET(CONCAT(int_column, string_column)) FROM mytable; always returns charset 'binary' and I need resulting charset to be same as a charset of a string_column because I don't want to look for charset of a co

Re: CONCAT() returns not correct character set

2006-03-02 Thread Hirofumi Fujiwara
Hi, Is there any difference between _binary'Binary' and CONVERT('Binary' USING binary) mysql> SELECT CHARSET(CONCAT(_binary'Bianry',CONVERT('abc' USING latin1))); +------+ | CHARSET(CONCAT

Re: CONCAT() returns not correct character set

2006-03-02 Thread sheeri kritzer
K, so concatenating the 2 should result in a binary according to the manual: mysql> SELECT CHARSET(CONCAT(_binary'Bianry',CONVERT('abc' USING latin1))); +-----

CONCAT() returns not correct character set

2006-02-26 Thread Hirofumi Fujiwara
Dear MySQL fans, I tested CONCAT() with binary strings and I got strange result. Manual says: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html If the arguments include any binary strings, the result is a binary string. But the following test says: bianry + latin1

CONCAT() And Columns

2006-01-18 Thread Shaun
Hi, I am trying to update a field so that it retains its contents plus the contents of another column like this: UPDATE MyTable SET Comments = CONCAT(Comments, 'Old_ID_Field = ', Old_ID_Field) WHERE Table_ID = 1; However I just get a blank Comments field, any ideas why this is

Re: CONCAT() And Columns

2006-01-18 Thread SGreen
"Shaun" <[EMAIL PROTECTED]> wrote on 01/18/2006 10:57:49 AM: > Hi, > > I am trying to update a field so that it retains its contents plus the > contents of another column like this: > > UPDATE MyTable SET Comments = CONCAT(Comments, 'Old_ID_Field =

RE: [SPAM] - concat string and update question - Found word(s) remove list in the Text body

2006-01-09 Thread Gordon Bruce
and 'phone' with the appropriate table and column name respectively. -Original Message- From: 2wsxdr5 [mailto:[EMAIL PROTECTED] Sent: Friday, January 06, 2006 8:09 PM To: mysql@lists.mysql.com Subject: [SPAM] - concat string and update question - Found word(s) remove list in the T

Re: concat() function

2005-10-12 Thread Luciano Centeno
I'm sorry, my mistake. The type definition is *nloc_num,ins_numero and ins_digi are decimal(5,0) 2005/10/11, Luciano Centeno <[EMAIL PROTECTED]>: > hello, my friends, the query "option 1" return the right value, > the query "option 2" not. Why concat function

Re: concat() function

2005-10-11 Thread Gleb Paharenko
eturn the right value, > the query "option 2" not. Why concat function make the difference? > > > *nloc_num,ins_numero and ins_digi are decimal(3,0) > > > > / > option 1 .- > > select

concat() function

2005-10-11 Thread Luciano Centeno
hello, my friends, the query "option 1" return the right value, the query "option 2" not. Why concat function make the difference? *nloc_num,ins_numero and ins_digi are decimal(3,0) / option 1 .- select max

Re: concat function problems

2005-07-29 Thread averyanov
PS after mysql reinstallation (upgrade from 4.1.12 to 4.1.13) from source code with EXACTLY THE SAME ./configure options as before and the SAME configuration file everything is OK -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql

Re: concat function problems

2005-07-29 Thread averyanov
resuming all above i can say that to my greatest regret nobody even expects what the matter is :( so i'll just try to install a newer version of server hoping the bug will disappear -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mys

Re: concat function problems

2005-07-27 Thread averyanov
t this error: >>>> >>>>ERROR 2006 (HY000): MySQL server has gone away >>>>No connection. Trying to reconnect... >>>>Connection id:6 >>>>Current database: test >>>>ERROR 2013 (HY000): Lost connection to MySQL server d

Re: concat function problems

2005-07-27 Thread Nuno Pereira
... Connection id:6 Current database: test ERROR 2013 (HY000): Lost connection to MySQL server during query but if i change my query to this one everything is fine SELECT COUNT(DISTINCT field1) as value1, CONCAT(field2, '') as value2 FROM table1, ta

Re: concat function problems

2005-07-26 Thread averyanov
Hello mysql, >> i've got a strange problem with concat() function >> >> i have the following data structure: >> >> CREATE TABLE table1 ( >> field1 int(11) NOT NULL auto_increment, >> PRIMARY KEY (field1) >> ) ENGINE=MyISAM DEFAULT CHARSE

Re: concat function problems

2005-07-26 Thread Nuno Pereira
but if i change my query to this one everything is fine SELECT COUNT(DISTINCT field1) as value1, CONCAT(field2, '') as value2 FROM table1, table2 GROUP BY value2 (here CONCAT(field2, '-') is replaced with CONCAT(field2, ''

Re: concat function problems

2005-07-26 Thread Michael Stassen
[EMAIL PROTECTED] wrote: i've got a strange problem with concat() function i have the following data structure: CREATE TABLE table1 ( field1 int(11) NOT NULL auto_increment, PRIMARY KEY (field1) ) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=3; CREATE TABLE table2 ( f

concat function problems

2005-07-26 Thread averyanov
i've got a strange problem with concat() function i have the following data structure: CREATE TABLE table1 ( field1 int(11) NOT NULL auto_increment, PRIMARY KEY (field1) ) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=3; CREATE TABLE table2 ( field2 varchar(255) NOT NULL de

Re: How to SELECT something (CONCAT) and search the field

2005-06-23 Thread Devananda
While the query "WHERE expr LIKE '%$user%'" works without fail, it can not use an index, and thus on large tables will be exceedingly slow. mysql> explain select last, first from users where concat(last,first) like '%user%'\G *

Re: How to SELECT something (CONCAT) and search the field

2005-06-23 Thread Ed Reed
I do this all the time and it works flawlessly. Just like your example and even more extreme. I use this technique to provide search mechamisms for my applications. ex, SELECT ID FROM table WHERE concat(field1, field2, field3,...{all the fields in the table}) Like '%searchstring%

RE: How to SELECT something (CONCAT) and search the field

2005-06-23 Thread mfatene
sql@lists.mysql.com > Subject: Re: How to SELECT something (CONCAT) and search the field > > > Hi, > what's your version ? in 4.11 the two forms work : > mysql> select concat(firstname,' ','lastname') from names; > +

RE: How to SELECT something (CONCAT) and search the field

2005-06-23 Thread Ben Kutsch
5 PM To: Matt Babineau Cc: mysql@lists.mysql.com Subject: Re: How to SELECT something (CONCAT) and search the field Hi, what's your version ? in 4.11 the two forms work : mysql> select concat(firstname,' ','lastname') from names; +---

Re: How to SELECT something (CONCAT) and search the field

2005-06-23 Thread mfatene
sorry for the first select (bad copy of a string 'lastname'): mysql> select concat(firstname,' ',lastname) from names where concat(firstname,' ',lastname) like 'Jean Dupond%'; ++ | concat(firstname,' ',lastnam

Re: How to SELECT something (CONCAT) and search the field

2005-06-23 Thread mfatene
Hi, what's your version ? in 4.11 the two forms work : mysql> select concat(firstname,' ','lastname') from names; +------+ | concat(firstname,' ','lastname') | +---

Re: How to SELECT something (CONCAT) and search the field

2005-06-23 Thread David Turner
to combine 2 fields and then search them > > SELECT first_name, lastname FROM user WHERE > CONCAT(first_name, ' ', > last_name) LIKE '%$user%' > > Does this make sense? The CONCAT function was the > closest I found to try and > do what I want to do. I alre

How to SELECT something (CONCAT) and search the field

2005-06-23 Thread Matt Babineau
Hey All- Got a fun question - I hit the manual but not much luck on my question. I want to combine 2 fields and then search them SELECT first_name, lastname FROM user WHERE CONCAT(first_name, ' ', last_name) LIKE '%$user%' Does this make sense? The CONCAT function was th

Re: RENAME TABLE with CONCAT string fails

2005-05-28 Thread Paul DuBois
At 17:50 +0200 5/28/05, [EMAIL PROTECTED] wrote: Hi, As Paul said, since concat gives a string, you can use this fact in preparing statement (v4.1). This works fine for me : Ah, yes. This'll work. I forgot about prepared statements. :-) But use replace to change '-'

Re: RENAME TABLE with CONCAT string fails

2005-05-28 Thread mfatene
Hi, As Paul said, since concat gives a string, you can use this fact in preparing statement (v4.1). This works fine for me : But use replace to change '-' to '_' in the table_name. set @tt:=concat('rename table flows_2005_05_27 to ',CONCAT("flows_", re

Re: RENAME TABLE with CONCAT string fails

2005-05-28 Thread Paul DuBois
At 11:00 -0400 5/28/05, Jason Dixon wrote: On May 28, 2005, at 8:51 AM, Paul DuBois wrote: At 8:12 -0400 5/28/05, Jason Dixon wrote: I'm trying to rename some tables for archival, but the table renaming is failing when I use CONCAT() to form the table string name: CONCAT() produ

Re: RENAME TABLE with CONCAT string fails

2005-05-28 Thread Jason Dixon
On May 28, 2005, at 8:51 AM, Paul DuBois wrote: At 8:12 -0400 5/28/05, Jason Dixon wrote: I'm trying to rename some tables for archival, but the table renaming is failing when I use CONCAT() to form the table string name: CONCAT() produces a string, not an identifier. Fine. Is ther

Re: RENAME TABLE with CONCAT string fails

2005-05-28 Thread Paul DuBois
At 8:12 -0400 5/28/05, Jason Dixon wrote: I'm trying to rename some tables for archival, but the table renaming is failing when I use CONCAT() to form the table string name: CONCAT() produces a string, not an identifier. mysql> RENAME TABLE flows TO flows_tmp, flows_new

RENAME TABLE with CONCAT string fails

2005-05-28 Thread Jason Dixon
I'm trying to rename some tables for archival, but the table renaming is failing when I use CONCAT() to form the table string name: mysql> RENAME TABLE flows TO flows_tmp, flows_new TO flows, flows_tmp TO CONCAT("flows_", DATE_SUB(CURDATE(), interval 1 day)); ERROR 1064: Yo

RE: CONCAT

2005-05-18 Thread Jay Blanchard
[snip] how to concat 2 columns to display in report? select column1concat column2 form table1; Concatenation Operator pl? [/snip] select concat('foo', 'bar') results foobar select concat('foo', ' ', 'bar') results foo bar --

CONCAT

2005-05-18 Thread Seena Blace
hi, how to concat 2 columns to display in report? select column1concat column2 form table1; Concatenation Operator pl? thanks - Discover Yahoo! Stay in touch with email, IM, photo sharing & more. Check it out!

Re: concat multirow subselect

2005-04-22 Thread Stano Paska
aaa values (1, 'aaa'), (2, 'bbb'); insert into bbb values (1, 1, '123'), (2, 1, '456'), (3, 2, '789'); I need display table aaa with last column concat values from bbb. Like this: | 1 | 'aaa' | '123 456' | | 2 | 'bbb&#x

Re: concat multirow subselect

2005-04-22 Thread Michael Stassen
7;aaa'), (2, 'bbb'); insert into bbb values (1, 1, '123'), (2, 1, '456'), (3, 2, '789'); I need display table aaa with last column concat values from bbb. Like this: | 1 | 'aaa' | '123 456' | | 2 | 'bbb' | '789' |

concat multirow subselect

2005-04-22 Thread Stano Paska
7;bbb'); insert into bbb values (1, 1, '123'), (2, 1, '456'), (3, 2, '789'); I need display table aaa with last column concat values from bbb. Like this: | 1 | 'aaa' | '123 456' | | 2 | 'bbb' | '789' | It is possible w

float type / concat

2005-04-04 Thread mel list_php
Hi list, I'm using php/mysql, I was updating a table through phpmyadmin then I saw that to update all the columns which type is declared to float the developper of phpmyadmin have added a concat. Something like: UPDATE `tableInduction` SET `inductionType` = 'screening' AND C

Re: update and concat

2004-12-01 Thread Michael Stassen
hat I remove all spaces before and after = and between CONCAT and (...). This worked. Too bad the manual is not more specific. Thanks for your concern, Tom On Nov 30, 2004, at 7:14 PM, Michael Stassen wrote: At this point, what you say you are doing should work, but doesn't. We cannot guess

Re: update and concat

2004-12-01 Thread Thomas McDonough
Someone else suggested that I remove all spaces before and after = and between CONCAT and (...). This worked. Too bad the manual is not more specific. Thanks for your concern, Tom On Nov 30, 2004, at 7:14 PM, Michael Stassen wrote: At this point, what you say you are doing should work, but

Re: update and concat

2004-11-30 Thread Michael Stassen
At this point, what you say you are doing should work, but doesn't. We cannot guess what's wrong. Please enter your command, UPDATE listings SET map = CONCAT(ML, '.png') WHERE ML <> ''; get your error message, and then copy/paste the whole thing into yo

Re: update and concat

2004-11-30 Thread Thomas McDonough
eading of the manual and mail archives tell me to do it like this: mysql> update listings set map= concat (ML, '.png') where ML<>''; mysql> update listings set map= concat(ML, '.png') where ML<>''; Lose the space between 'concat' a

Re: update and concat

2004-11-30 Thread gerald_clark
Thomas McDonough wrote: I'm trying to set all the values of column 'map' to the value of column ML and '.png'. My intuition and an extensive reading of the manual and mail archives tell me to do it like this: mysql> update listings set map= concat (ML, '.p

Re: update and concat

2004-11-30 Thread Roger Baklund
Thomas McDonough wrote: I'm trying to set all the values of column 'map' to the value of column ML and '.png'. My intuition and an extensive reading of the manual and mail archives tell me to do it like this: mysql> update listings set map= concat (ML, '.png

update and concat

2004-11-30 Thread Thomas McDonough
I'm trying to set all the values of column 'map' to the value of column ML and '.png'. My intuition and an extensive reading of the manual and mail archives tell me to do it like this: mysql> update listings set map= concat (ML, '.png') where ML<>

Re: MySQL 4.0 and concat

2004-10-11 Thread William R. Mussatto
orgets that. > Have you considered NOT comparing dates as strings but rather as date > values? That will avoid the use of CONCAT() completely. > > > SELECT * > FROM sampletable > WHERE datefield >= '1999-01-12' and datefield <'1999-02-01' > > This exa

Fwd: Re: MySQL 4.0 and concat

2004-10-11 Thread Alfredo Cole
Sorry. This should have gone back to the list. -- Mensaje reenviado -- Subject: Re: MySQL 4.0 and concat Date: Lun 11 Oct 2004 11:37 From: Alfredo Cole <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] El Lun 11 Oct 2004 08:35, escribió: > Have you considered NOT comparing

Re: MySQL 4.0 and concat

2004-10-11 Thread SGreen
Have you considered NOT comparing dates as strings but rather as date values? That will avoid the use of CONCAT() completely. SELECT * FROM sampletable WHERE datefield >= '1999-01-12' and datefield <'1999-02-01' This example query will get all of the records

MySQL 4.0 and concat

2004-10-11 Thread Alfredo Cole
Hi: I have a problem in that all statements that include concat execute very slowly. For instance, if I have three fields in string format that represent a year, month and day, and want to issue a select like: select * from cxcmanpag where contact (year,month,day)<=stringYear+stringMo

Re: Concat

2004-08-31 Thread Martijn Tonies
> Concat() returns Null if any field in the field list > is Null. How can I use it to return a String > regardless, or is there another function to do it? COALESCE(value,...) Returns the first non-NULL value in the list. mysql> SELECT COALESCE(NULL,1); -> 1 mysql> SE

Re: Concat

2004-08-31 Thread Mikhail Entaltsev
select concat(ifnull(Field1,'NULL'), Filed2) from My Table; - Original Message - From: "A Z" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, August 31, 2004 2:25 PM Subject: Concat > > Hi, > > Concat() returns Null if any field in

Concat

2004-08-31 Thread A Z
Hi, Concat() returns Null if any field in the field list is Null. How can I use it to return a String regardless, or is there another function to do it? regards ___ALL-NEW Yahoo! Messenger - all new

Re: Concat fields

2004-08-12 Thread SGreen
Philippe, If he is pre-4 (I assume that as he does not seem to have the GROUP_CONCAT() function) and UDFs aren't available until 5+, how exactly would he do this as a UDF? :-D Paul, I believe you are going to have to combine those fields during some form of post-query processing (macro, script,

Re: Concat fields

2004-08-12 Thread Egor Egorov
Philippe Poelvoorde <[EMAIL PROTECTED]> wrote: >>>If I am not running 4, is there another way to achieve the same result as >>>GROUP_CONCAT(myField) >>>? >> >> I don't think so. :( > > Except if you are ready to make a User-defined function to make a simple > group_concat... > http://dev.mysq

Re: Concat fields

2004-08-12 Thread Philippe Poelvoorde
Egor Egorov wrote: "Paul McNeil" <[EMAIL PROTECTED]> wrote: If I am not running 4, is there another way to achieve the same result as GROUP_CONCAT(myField) ? I don't think so. :( Except if you are ready to make a User-defined function to make a simple group_concat... http://dev.mysql.com/doc/m

Re: Concat fields

2004-08-11 Thread Egor Egorov
"Paul McNeil" <[EMAIL PROTECTED]> wrote: > If I am not running 4, is there another way to achieve the same result as > GROUP_CONCAT(myField) > ? I don't think so. :( -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://w

RE: Concat fields

2004-08-11 Thread Paul McNeil
If I am not running 4, is there another way to achieve the same result as GROUP_CONCAT(myField) ? God Bless Paul C. McNeil Developer in Java, MS-SQL, MySQL, and web technologies. Microneil research Sortmonster Anti Spam GOD BLESS AMERICA! To God Be The Glory! -- MySQL Genera

Re: RE Concat fields

2004-08-11 Thread Michael Stassen
ng the event ID. pseudo SQL Select concat(data from all grouped fields) from foo group by (eventID); God Bless Paul C. McNeil Developer in Java, MS-SQL, MySQL, and web technologies. Microneil Research Sortmonster Anti Spam -- MySQL General Mailing List For list archives: http://lists.mysql.com/my

RE Concat fields

2004-08-11 Thread Paul McNeil
Thank you for your response, Egor. My question is whether or not it is possible to concatenate the fields without knowing the event ID. pseudo SQL Select concat(data from all grouped fields) from foo group by (eventID); God Bless Paul C. McNeil Developer in Java, MS-SQL, MySQL, and web

Re: Concat fields

2004-08-11 Thread Egor Egorov
"Paul McNeil" <[EMAIL PROTECTED]> wrote: > How can I combine the elements from many text fields into one text field. See http://dev.mysql.com/doc/mysql/en/String_functions.html, in particular, you need CONCAT() > I have a table. > ID(auto inc) eventID data &g

Concat fields

2004-08-11 Thread Paul McNeil
Good morning to all. How can I combine the elements from many text fields into one text field. I have a table. ID(auto inc) eventID data ID is unique eventID is repeated data represents what happened at this event. I would like to return all of the data for a given event ID, sorted b

Re: Large inserts, chunking and Concat

2004-05-19 Thread John Ling
Part of the problem was the way the server settings were allocating memory. The concat would work until a certain size and then the suddenly failed to insert (inserted NULL). After the memory configuration change, in terms of concatenating (with CONCAT) in pieces, it seems to work at least

Large inserts, chunking and Concat

2004-05-17 Thread John Ling
Concat command? My concern is whether this will still in someway cause me other MySQL resource problems? I want to be able to insert a large text or blob of over 200-400MBs. Thanks, John -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http

Re: Problem setting default value for column with concat()

2004-05-06 Thread gerald_clark
Tim Russell wrote: Hi all, When I run the following code the default value isn't being calculated using the concat and other functions. Instead it is setting the column definition as a string: CONCAT("TMP How can I rework this to get a result more like TMP-T-2 ? You can&

Problem setting default value for column with concat()

2004-05-06 Thread Tim Russell
Hi all, When I run the following code the default value isn't being calculated using the concat and other functions. Instead it is setting the column definition as a string: CONCAT("TMP How can I rework this to get a result more like TMP-T-2 ? USE cro; CREATE TABL

Re: Concat. operator ||

2004-02-24 Thread Hassan Shaikh
Hi Paul, Using the following fixed things. However, I am surprised at why it is not working in 4.0.18 (Win32)? Previously I had 4.0.17 (Win32) and things work perfectly. I guess you are right, it's a bug. [mysqld] sql-mode=REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ONLY_FULL_GROUP_B

Re: Concat. operator ||

2004-02-23 Thread Paul DuBois
At 17:20 -0600 2/23/04, Paul DuBois wrote: At 12:50 -0600 2/23/04, Paul DuBois wrote: At 15:59 +0200 2/23/04, Victoria Reznichenko wrote: Hassan Shaikh <[EMAIL PROTECTED]> wrote: I am running MySQL in ANSI standard mode. However the following statement is giving unexpected result. Am I missing so

Re: Concat. operator ||

2004-02-23 Thread Paul DuBois
At 12:50 -0600 2/23/04, Paul DuBois wrote: At 15:59 +0200 2/23/04, Victoria Reznichenko wrote: Hassan Shaikh <[EMAIL PROTECTED]> wrote: I am running MySQL in ANSI standard mode. However the following statement is giving unexpected result. Am I missing something? mysql> select 'This is a' || '

Re: Concat. operator ||

2004-02-23 Thread Paul DuBois
At 15:59 +0200 2/23/04, Victoria Reznichenko wrote: Hassan Shaikh <[EMAIL PROTECTED]> wrote: I am running MySQL in ANSI standard mode. However the following statement is giving unexpected result. Am I missing something? mysql> select 'This is a' || ' test string'; +---

Re: Concat. operator ||

2004-02-23 Thread Victoria Reznichenko
Hassan Shaikh <[EMAIL PROTECTED]> wrote: > > I am running MySQL in ANSI standard mode. However the following > statement is giving unexpected result. Am I missing something? > >mysql> select 'This is a' || ' test string'; >+---+ >| 'This is a' || ' test st

Re: Concat. operator ||

2004-02-23 Thread Rhino
re && and AND. Because of this nice syntax, MySQL Server doesn't support the standard SQL-99 || operator for string concatenation; use CONCAT() instead. Because CONCAT() takes any number of arguments, it's easy to convert use of the || operator to MySQL Server." If you rewrite y

  1   2   >