RE: IF and CASE

2013-02-05 Thread Rick James
As a Rule of Thumb, function evaluation time is not significant to the overall time for running a query. (I see IF and CASE as 'functions' for this discussion.) Do you have evidence that says that IF is slower? Perhaps using BENCHMARK()? -Original Message- From: h...@tbbs.net

RE: IF and CASE

2013-02-05 Thread hsv
2013/02/05 17:06 +, Rick James As a Rule of Thumb, function evaluation time is not significant to the overall time for running a query. (I see IF and CASE as 'functions' for this discussion.) Do you have evidence that says that IF is slower? Perhaps using BENCHMARK()? Not BENCHMARK: I

Re: binary select - case sensitive

2006-07-05 Thread Chris
kalin mintchev wrote: hi all... i found this on the mysql dev manual site: MySQL 4 and later string comparisons, including DISTINCT, aren't case sensitive unless the field is declared as BINARY or you use BINARY in your comparison. so here i tried it but no good. any ideas?! the field is not

Re: binary select - case sensitive

2006-07-05 Thread kalin mintchev
http://dev.mysql.com/doc/refman/5.1/en/charset-binary-op.html It has some good examples. got it thanks... -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

RE: Repost: Lower Case Problems with Win XP Pro and 5.0.6 MySQL

2005-06-14 Thread Tom Horstmann
mysql create table ABC (col1 varchar(10)); Query OK, 0 rows affected (0.03 sec) mysql show tables; +--+ | Tables_in_userdb | +--+ | abc | +--+ 1 row in set (0.00 sec) mysql NOTE THE FACT THAT THE TABLE IS created in

RE: Question about case statement

2004-08-11 Thread Lachlan Mulcahy
Hi there, What you probably want is UPDATE temp SET QE = CASE WHEN QE = 1 THEN 6 END QF = CASE WHEN QF = 1 THEN 5 END WHERE QA = 1 AND (QE 6 OR QF 5) http://dev.mysql.com/doc/mysql/en/Control_flow_functions.html Lachlan -Original Message- From: Mo Li [mailto:[EMAIL

Re: Question about case statement

2004-08-11 Thread Michael Stassen
The original problem was that CASE returns the result corresponding to the matching condition. It isn't really a flow-control function. I don't think Lachlan's suggestion is right either, though. Its missing a comma, I think, but more importantly, it will set QE and QF to NULL whenever they

Re: Column name case sensitive problem?

2004-07-21 Thread aman
Java is case sensitive, this is the way JDBC wants you to work. The Exception is generated by JDBC, not due to an error from MySQL. I would recommend checking JDBC documentation. Aman Raheja http://www.techquotes.com On Wed, 2004-07-21 at 10:55, Ying Lu wrote: Hello, I have a question

Re: all upper case records.. Keeping first char upper and rest lower?

2004-07-13 Thread Wesley Furgiuele
SELECT CONCAT( UPPER( LEFT( first, 1 ) ), LOWER( RIGHT( first, LENGTH( first ) - 1 ) ) ) AS `first` FROM table On Jul 13, 2004, at 12:51 PM, Aaron Wolski wrote: Hey guys, I have a column in a table called 'first'. Currently all records are upper case. Is it possible for me to do a select

RE: all upper case records.. Keeping first char upper and rest lower?

2004-07-13 Thread Aaron Wolski
Furgiuele [mailto:[EMAIL PROTECTED] Sent: July 13, 2004 1:10 PM To: Aaron Wolski Cc: [EMAIL PROTECTED] Subject: Re: all upper case records.. Keeping first char upper and rest lower? SELECT CONCAT( UPPER( LEFT( first, 1 ) ), LOWER( RIGHT( first, LENGTH( first ) - 1 ) ) ) AS `first` FROM

Re: all upper case records.. Keeping first char upper and rest lower?

2004-07-13 Thread Michael Kruckenberg
It's ulgy, and I'm not sure how efficient it is, but this will do the trick: select concat(left(first,1),substring(lower(first) from 2)) as first; Aaron Wolski wrote: Hey guys, I have a column in a table called 'first'. Currently all records are upper case. Is it possible for me to do a select

Re: making lower case then first char to upper case?

2004-07-02 Thread Thomas Spahni
On Wed, 30 Jun 2004, Aaron Wolski wrote: Hi Guys, I'm trying to figure out of this is possible. I know I could do it in PHP but I am dealing with a ton of records and would rather put the processing on the DB than PHP/client side. Question is. can I do a SELECT query on a column that

Re: making lower case then first char to upper case?

2004-06-30 Thread Wesley Furgiuele
Someone else hopefully has something more efficient: UPDATE table SET field = CONCAT( UPPER( LEFT( field, 1 ) ), LOWER( SUBSTRING( field, 2 ) ) ) Wes On Jun 30, 2004, at 12:46 PM, Aaron Wolski wrote: Hi Guys, I'm trying to figure out of this is possible. I know I could do it in PHP but I am

RE: MySQL SQL Case Stetement

2004-06-18 Thread Paul McNeil
I have used the CASE statement for ordering many times. It's very useful... SELECT myDATA, CASE WHEN data2 = SomeValue THEN 0 ELSE WHEN data2 = SomeOtherValue THEN 1 ELSE 2 END AS mySort from MyTable Where myConstraints. God Bless Paul C. McNeil Developer in Java, MS-SQL, MySQL, and web

Re: MySQL SQL Case Stetement

2004-06-18 Thread Michael Stassen
The CASE function is documented in the manual http://dev.mysql.com/doc/mysql/en/Control_flow_functions.html. SELECT CASE WHEN other_col 100 THEN 'low' WHEN other_col BETWEEN 100 AND 1000 THEN 'medium' WHEN other_col 1000 THEN 'high' END AS col FROM your_table; Michael Rafi

Re: Table Name Case Sensitivity

2004-02-23 Thread Jochem van Dieten
Tim Hayes said: Can anyone offer advice? I have come across a MySQL database on Linux with duplicate table names - Accounts and accounts. This seems fine on Linux, but does not transfer to the Windows environment - it is rejected because of the duplicate name. However I do see that Column

Re: Table Name Case Sensitivity

2004-02-23 Thread Alec . Cawley
Tim Hayes [EMAIL PROTECTED] wrote on 23/02/2004 16:15:36: Can anyone offer advice? I have come across a MySQL database on Linux with duplicate table names - Accounts and accounts. This seems fine on Linux, but does not transfer to the Windows environment - it is rejected because of

Re: Table Name Case Sensitivity

2004-02-23 Thread Tim Hayes
- From: Peter Zaitsev [EMAIL PROTECTED] To: Tim Hayes [EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:19 PM Subject: Re: Table Name Case Sensitivity On Mon, 2004-02-23 at 08:15, Tim Hayes wrote: Can anyone offer advice? Run with lower_case_table_names=1 I have come across

Re: Table Name Case Sensitivity

2004-02-23 Thread Heikki Tuuri
. I think it is bad programming style to have tables whose name only differs in case. I recommend using in my.cnf lower_case_table_names=1 on all platforms. Regards, Heikki .. List: MySQL General Discussion From: Tim Hayes Date:February 23 2004 5:56pm Subject: Re: Table Name Case

Re: Table Name Case Sensitivity

2004-02-23 Thread Paul DuBois
At 16:56 + 2/23/04, Tim Hayes wrote: OK There is still the possibility of an in-compatability between the 2 platforms. However - in both Linux and Windows (MySQL 4.0.17) the variable is not recognized / updateable using the set command! Correct. You must set it using an option at server

Re: Table Name Case Sensitivity

2004-02-23 Thread Peter Zaitsev
On Mon, 2004-02-23 at 08:56, Tim Hayes wrote: OK There is still the possibility of an in-compatability between the 2 platforms. However - in both Linux and Windows (MySQL 4.0.17) the variable is not recognized / updateable using the set command! I get - Unknown system variable

Re: WHERE with CASE colums?

2003-12-04 Thread Martijn Tonies
Hi Scott, === When searching and listing them I want to remove any preceeding 'The ', 'An ', or 'A ' that occurs in the title and I also want to be able to search it. The case statement as follows seems to work fine: SELECT CASE WHEN title LIKE 'The %' THEN RIGHT( title, length( title ) -4 )

Re: WHERE with CASE colums?

2003-12-04 Thread Yves Goergen
On Thursday, December 04, 2003 6:22 PM CET, Martijn Tonies wrote: Cause the WHERE clause only works on columns. If you want to do a match on the result of the CASE, you have to do your case thingy again: WHERE ( case ...yourstuff... end ) = 'something' Wouldn't HAVING help here? -- Yves

Re: changing the case of data

2003-11-30 Thread Ed Leafe
On Nov 30, 2003, at 8:24 AM, Frank Surget wrote: Was wondering if someone had a solution. I have a database of image names that a PHP app points to. Some of the image names are upper case. Can anyone suggest the syntax of an Update statement that will change all Upper Case letters to lower??

re: Bug with CASE expression in Update statement

2002-12-23 Thread Victoria Reznichenko
On Monday 23 December 2002 17:54, Robert Berman wrote: SELECT Company_ID, COUNT(*) FROM Eric GROUP BY Company_ID; ++--+ | Company_ID | COUNT(*) | ++--+ | NULL | 10 | ++--+ 1 row in set (0.00

RE: Mysql Table Case

2002-08-15 Thread Nilesh Shah
Answer is No. Case-sensitivity of table names depends on operating system you are running mysql on.MySQL stores table definitions in TABLENAME.* files. So it will always be case-sensitive on *nix and case-insensitive on windows. Nilesh -Original Message- From: James Kelty

Re: Mysql Table Case

2002-08-15 Thread Paul DuBois
At 9:59 -0700 8/15/02, James Kelty wrote: Hello, Is there a compile option or startup option to make mysql ignore table name case? So that the tables security and Security would be seen as the same table? --set-variable=lower_case_table_names=1 But you should rename your tables to lowercase

RE: Mysql Table Case

2002-08-15 Thread James Kelty
Kelty; [EMAIL PROTECTED] Subject: RE: Mysql Table Case Answer is No. Case-sensitivity of table names depends on operating system you are running mysql on.MySQL stores table definitions in TABLENAME.* files. So it will always be case-sensitive on *nix and case-insensitive on windows. Nilesh

RE: Decode to Case

2002-06-05 Thread Tommy Claasens - Q Data KZN
Try a function called coaleace It will return the non null value. But i dont have the exact syntax with me nor the manual. Hope it helps Tommy -Original Message- From: Arul [mailto:[EMAIL PROTECTED]] Sent: Wed, 05 Jun 2002 13:26 To: MySQL Subject: Decode to Case Hi All I am

Re: Decode to Case

2002-06-05 Thread Arul
= 2) -Arul - Original Message - From: Tommy Claasens - Q Data KZN [EMAIL PROTECTED] To: Arul [EMAIL PROTECTED]; MySQL [EMAIL PROTECTED] Sent: Wednesday, June 05, 2002 5:54 PM Subject: RE: Decode to Case Try a function called coaleace It will return the non null value. But i dont have

RE: Table names case sensitivity

2002-01-31 Thread Mr Kent Cheung
Neil, Thank you for your suggestion. Unfortunately, the Grant command grants privileges to lower case table names also. I have also tried to find solution from archive of mysql mail lists but nothing useful have been found. Kent. --- Neil Silvester [EMAIL PROTECTED] wrote: -Original

Re: Unique and case-insensitivity with indexes

2001-11-12 Thread Bill Adams
Fulko Hew wrote: I am using mySQL 3.22.4a-beta yes, I know its old :-( I have just stumbled across a problem with how it treats 'uniqueness' in table contents. I have a table with a column defined as: create table test (name varchar(80) not null); alter table test ADD UNIQUE

RE: Unique and case-insensitivity with indexes

2001-11-12 Thread Christopher Book
If you create your columns with the 'binary' parm (look in the manual), then all the comparisons will be case-sensitive. Can anyone either point out what I am doing wrong, or a workaround? database, mysql, table -

Re: Unique and case-insensitivity with indexes

2001-11-12 Thread Fulko Hew
Bill Adams [EMAIL PROTECTED] replied: Fulko Hew wrote: I am using mySQL 3.22.4a-beta yes, I know its old :-( I have just stumbled across a problem with how it treats 'uniqueness' in table contents. I have a table with a column defined as: create table test (name

Re: Unique and case-insensitivity with indexes

2001-11-12 Thread Giuseppe Maxia
12/11/2001 17:34:07, Fulko Hew [EMAIL PROTECTED] wrote: I am using mySQL 3.22.4a-beta yes, I know its old :-( I have just stumbled across a problem with how it treats 'uniqueness' in table contents. I have a table with a column defined as: create table test (name varchar(80) not null);

Re: Unique and case-insensitivity with indexes

2001-11-12 Thread Fulko Hew
Giuseppe Maxia [EMAIL PROTECTED] responded: The workaround is to use the attribute BINARY for your field create table test (myfield varchar(80) BINARY not null, UNIQUE KEY myfield); This way, the index is case sensitive. Unfortunately, this feature was introduced in MySQL 3.23, so your

RE: to upper case function

2001-03-27 Thread Cal Evans
http://www.mysql.com/doc/S/t/String_functions.html UCASE(str) UPPER(str) Returns the string str with all characters changed to uppercase according to the current character set mapping (the default is ISO-8859-1 Latin1): mysql select UCASE('Hej'); - 'HEJ' This function is multi-byte