Ask a Question related to Coldfusion Database Access, Design and Development.
-
22 #1
Group By and Ignore Case
Is it possible to build a select query that groups by a value, but ignores the
character case of the source values? For example, GROUP BY that searches a
column for 'test" and "TEST" would combine the two values instead of grouping
them separately.
22 Guest
-
"group by" - order of rows in group
this is simple example: TABLE SCHEMA: create table my_table( id int unsigned not null auto_increment primary key, project varchar(255) not... -
May 29 Sydney Developers Group study group
On Monday 29th May, we'll be studying Actionscript 3. Please read the articles prior to the meeting (see <a target=_blank... -
cfgrid inside a <cfoutput query="myQuery" group="GROUP">
Is it possible to use a cfgrid inside a cfoutput with a query and a group. When I try do that I get the following error: INVALID_CHARACTER_ERR:... -
Can String.indexOf() ignore case?
I have a simple search which takes what is in the text input box ans searches through an array trying to find a match. I've found a nice and... -
#23026 [Com]: Make Zend case-sensitive (classes, functions, remove case-insensitive)
ID: 23026 Comment by: nvivo at mandic dot com dot br Reported By: mfischer@php.net Status: Open Bug Type: ... -
paross1 #2
Re: Group By and Ignore Case
Different databases have different function names for converting to upper or
lower case (ucaselcase in Access, upper/lower in Oracle and MSSQL, etc.) When
you use GROUP BY, you need to use the same columns (without the aggregrate
column) that you use in the SELECT, so if you wish to do a caseless group by on
a column, you would need to convert the column in the select as well as in the
group by.
For example,
SELECT UPPER(last_name) AS UClast_name, COUNT(*) AS user_count
FROM yourtable
GROUP BY UPPER(last_name)
would give you a count by last name, regardless of the case. However, as you
can see, your SELECTed value is now upper case, which may not be what you want
to see in your output.
Phil
paross1 Guest
-
22 #3
Re: Group By and Ignore Case
I used the Lcase() function in cfquery, but it only works in a direct query. I was trying to use it in the query of queries.
22 Guest



Reply With Quote

