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
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
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
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]
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
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
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
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
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
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
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
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
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
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
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
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
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
-
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
.
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
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
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
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 )
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
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??
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
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
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
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
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
= 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
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
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
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
-
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
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);
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
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
37 matches
Mail list logo