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%'; it works perfectly (and as it did in 4.x

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,'%'); +---+ | name

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,direction,version) as operation

RE: CONCAT with IF?

2009-07-08 Thread Gavin Towey
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... Here's what I've tried... CREATE TABLE test (version char(10), direction char(2

Re: left joins concat

2009-02-22 Thread Claudio Nanni
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 af.gour...@videotron.ca I have been searching and searching for a clear and logical

Re: left joins concat

2009-02-22 Thread PJ
tables!! After you connect(join) the two tables you could want to 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 af.gour

Re: left joins concat

2009-02-22 Thread PJ
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 to work... long hours

Re: left joins concat

2009-02-22 Thread Walter Heck
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 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

Re: left joins concat

2009-02-22 Thread PJ
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 Author works, nor the AS ab and AS abc. Does the order of ab and abc matter? Are they related... I

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', COALESCE(r.title,''), '\n', COALESCE

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.reg_id=121 if any of columns has value (e.g. title) NULL, I'll get as result 0

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, ''), ' ', COAESCE(b

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 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 string when it's NULL, you

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,''), '\n', COALESCE(a.address1, ''), '\n

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 does

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_name

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: hi, I

Re: CONCAT doesn't work with NULL?

2008-05-14 Thread wim . delvaux
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 NULL. CONCAT_WS() does not skip empty strings. However, it does skip any NULL values after

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, '\n', r.email) FROM registrants r, addresses a WHERE r.reg_id=121 if any

Re: CONCAT doesn't work with NULL?

2008-05-14 Thread 王旭
- From: Afan Pasalic [EMAIL PROTECTED] To: ewen fortune [EMAIL PROTECTED] Cc: mysql@lists.mysql.com Sent: Thursday, May 15, 2008 12:52 AM Subject: Re: CONCAT doesn't work with NULL? actually, this will not work for me (or I got it wrong :D) because I need to have street, state and zip in one line

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 slow command to run. The select statement

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,port from

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 currently looks like this. select

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,'@',domain

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 charset(concat(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 CONCAT(id, ',', Name) doesn't

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

2007-02-01 Thread ViSolve DB Team
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) | +--+ | 1,a | | 1,b | | 1,c

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 column whenever I have

Re: CONCAT() returns not correct character set

2006-03-02 Thread sheeri kritzer
according to the manual: mysql SELECT CHARSET(CONCAT(_binary'Bianry',CONVERT('abc' USING latin1))); +--+ | CHARSET(CONCAT(_binary'Bianry',CONVERT('abc' USING latin1))) | +--+ | latin1

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(_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

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 = ', Old_ID_Field) WHERE Table_ID = 1; However I

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 happening

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

2006-01-09 Thread Gordon Bruce
. -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 Text body I have a table of people and their phone numbers, some have the area

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 make the difference? *nloc_num,ins_numero

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(bi_num) as num from b_inmuebles

Re: concat() function

2005-10-11 Thread Gleb Paharenko
, 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(bi_num) as num from b_inmuebles where concat(nloc_num) =3D 1

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:

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:

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, table2 GROUP

Re: concat function problems

2005-07-27 Thread averyanov
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, table2 GROUP BY value2 (here CONCAT(field2

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 default

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 ( field2

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, '') ) does anyone know what

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 CHARSET=cp1251 AUTO_INCREMENT=3; CREATE TABLE table2 ( field2 varchar

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 the closest I found

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

2005-06-23 Thread David Turner
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 alread tried this: SELECT concat(first_name, ' ', last_name) as fullname FROM user... This did

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') | +--+ | Jean lastname

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,' ',lastname) | ++ | Jean Dupond

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

2005-06-23 Thread Ben Kutsch
: 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; +--+ | concat(firstname,' ','lastname

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

2005-06-23 Thread mfatene
and last name columns 'Billy Ray' Smith and John 'Von Hoenhiem' would cause problems -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, June 23, 2005 4:05 PM To: Matt Babineau Cc: mysql@lists.mysql.com Subject: Re: How to SELECT something (CONCAT

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 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 *** 1. row

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: You have an error in your

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 TO flows, flows_tmp

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 there any

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() produces

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_, replace(DATE_SUB(CURDATE(), interval 2 day

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

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

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 -- MySQL General Mailing List For list archives: http

concat multirow subselect

2005-04-22 Thread Stano Paska
'); 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 with version 4.1.x? Or I must upgrade to 5.0.x and use stored procedures? Stano. -- MySQL

Re: concat multirow subselect

2005-04-22 Thread Michael Stassen
, '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' | It is possible with version 4.1.x? Or I must upgrade to 5.0.x and use stored

Re: concat multirow subselect

2005-04-22 Thread Stano Paska
into 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' | '789' | It is possible with version 4.1.x? Or I must upgrade to 5.0.x

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 CONCAT( `volume

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

Re: update and concat

2004-12-01 Thread Michael Stassen
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 what's wrong. Please

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''; but all I get is this: ERROR 1064 (42000): You

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') where ML''; but all I get

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, '.png') where ML''; mysql update

Re: update and concat

2004-11-30 Thread Thomas McDonough
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' and '(' but all I get is this: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual

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 your next message. That way, someone

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+stringMonth

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 from sampletable that were entered

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 dates

Re: MySQL 4.0 and concat

2004-10-11 Thread William R. Mussatto
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 from sampletable that were entered after

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

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 the field list is Null. How can I use it to return

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 SELECT COALESCE(NULL,NULL

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...

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...

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,

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

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 ID is unique eventID

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: RE Concat fields

2004-08-11 Thread Michael Stassen
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/mysql

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

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

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
the 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

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 TABLE lpamform

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't. Default

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]

Concat. operator ||

2004-02-23 Thread Hassan Shaikh
Hi All, 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 string' | +---+

Re: Concat. operator ||

2004-02-23 Thread Rhino
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 your query as follows, you should get

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 string' |

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 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' || '

  1   2   >