GROUP_CONCAT()
Hi All,
Is there an Oracle equivalent of the GROUP_CONCAT function?
My problem:
Table A:
=========
ID NAME
=========
1 Test 1
2 Test 2
Table B:
=======
B_ID A_ID PERCENT DESCRIPTION
===============================
1 1 30 Desc1
2 1 70 Desc2
3 2 20 Desc3
4 2 20 Desc4
5 2 40 Desc5
6 2 20 Desc6
In my report, I would like to see the following:
Test Result
===================
Test 1 30% Desc1; 70% Desc2;
Test 2 20% Desc3; 20% Desc4; 40% Desc5; 20%Desc6;
How can I achieve that in Oracle/Apex?
Thanks in advance.
OD
it could be i just searched google and that is what came up
http://www.orafaq.com/forum/m/135323/43055/?srch=concat_all#msg_135323
maybe try decode?
Message was edited by:
[email protected]
Similar Messages
-
T-SQL Equivalent For Group_Concat() Function
Hello, I am looking for a way to do the MSSQL T-SQL equivalent of the MySQL aggregate function: group_concat().
We are running SQL 2005 Express. Is there a pure T-SQL way to do this, or if not, a way to create a new custom aggregate function?
EX:
SELECT GROUP_CONCAT(FIRST_NAME) AS STUDENT_LIST FROM STUDENTS GROUP BY TEACHER
OUTPUT:
JOSH,JOEY,MARK,LINDA,PAM,BILL,MIKE,JUSTINCan anyone help me with MS SQL equivalent code for below MySQL statement.
select group_concat
(Col1
order
by field(Col2,8,13,15,53,55,6,73,75,3,42,41,45,44))
as FinalColumn from TestTable
Any help is greatly appriciated... thanks in advance... -
Group_concat on multiple tables
Hello, I have been spinning my wheels for countless hours trying to figure this one out. Hope someone can lend a hand! ;-)
I have 4 tables:
1) Field_Tickets - Field_Tickets.field_tickets_id is the main field I wish to group on.
2) Field_Tickets_Has_Employees - This is joined by Field_Tickets.field_tickets_id=Field_Tickets_Has_Employees.field_tickets_id.
3) Employees - This is joined by Field_Tickets_Has_Employees.employees_id=Employees.employees_id
4) Employee_Roles - This is joined by Field_Tickets_Has_Employees.employee_roles_id=Employee_Roles.employee_roles_id
I would like to create a group concatenated string in crystal that looks like the following result:
Supervisor Lynn Jones
Assistant Alan Cyr
I had to write two separate statements, in the Command window, to achieve what I'm after and it still doesn't associate the correct role with the corresponding employee. I need to write it in one select group_concat but have been spinning my wheels for too many hours now. Here's the sql I have written:
select ft.field_tickets_id,
(SELECT GROUP_CONCAT(CONCAT(emp.employee_first_name, ' ',emp.employee_last_name, '\n') SEPARATOR'') from employees AS emp WHERE (SELECT DISTINCT(fte.employees_id) from field_tickets_has_employees as fte WHERE ft.field_tickets_id=fte.field_tickets_id AND fte.employees_id=emp.employees_id AND IsNull(fte.deleted_at) AND fte.employee_roles_id IN (281, 282, 283, 284) group by ft.field_tickets_id)) AS employeelist,
(SELECT GROUP_CONCAT(CONCAT(emprole.employee_role_name, '', '\n') SEPARATOR '') from employee_roles AS emprole WHERE (SELECT DISTINCT(fte2.employees_id) from field_tickets_has_employees as fte2 WHERE ft.field_tickets_id=fte2.field_tickets_id AND fte2.employee_roles_id=emprole.employee_roles_id AND IsNull(fte2.deleted_at) AND fte2.employee_roles_id IN (281, 282, 283, 284) group by ft.field_tickets_id)) AS emplistroles
from field_tickets AS ft
INNER JOIN jobs ON ft.jobs_id=jobs.jobs_id where
IsNull(ft.deleted_at)
Thanks!
Markgotcha...definitely makes sense for a command object then.
question...does mysql support the WITH directive where tables are derived and then can be referenced in the final SELECT? see an example of syntax here. if it is supported, then this may be a more convenient way of creating your command as you can create a derived table for the employee info, one for the role info, and then bring those in in the main query below using the where clause. -
Using GROUP_CONCAT (MYSQL) in BO XI Universe
Hi,
I have an error using group_concat in an universe (XI R3) : it works with a single table and a single text field query but does not work anymore :
- with a second aggregate field on the same table SUM(numeric field) + GROUP BY : the GROUP_CONCAT is automatically generated in the GROUP BY section as it should not
- with a second text field from another inner joinned table
Exception: DBD, [MySQL][ODBC 5.1 Driver][mysqld-5.0.51a-23~bpo40+1-log]Utilisation invalide de la clause GROUPState: HY000
Does anyone has ever used GROUP_CONCAT in a BO XI Universe ?
Thanks for your help.
SebastienHi all,
I am facing the same issue but can not find any solution.
Have you got any update on your side ?
Thanks -
OT: MySQL GROUP_CONCAT Question
Are there any MySQL gurus here who understand MySQL's
GROUP_CONCAT
function? I'm trying to figure out how it works.
This is the query I started with:
$res = mysql_query ("SELECT * FROM cia_ppl CP
LEFT JOIN gw_geog GG on GG.IDArea = CP.ID_Name
LEFT JOIN cia_notes CN on CN.IDName = CP.ID_Name
WHERE CP.Pop != 0") or die (mysql_error());
It works, except that it only displays the first value in
cia_notes.ID_Note in a particular cell. For example, consider
the
following example where there are two notes listed for the
U.S. in table
cia_notes...
ID_Name \ ID_Note
can \ Pop
mex \ Ppl
usa \ Pop
usa \ Ppl
My web page might display the following:
Name \ Population \ Notes
Canada \ 60 million \ Pop
Mexico \ 80 million \ Ppl
United States \ 300 million \ Pop
When I want the last row to look like this:
United States \ 300 million \ PopPpl
I want to use MySQL's SEPARATOR function to insert commas and
a PHP
str_replace to convert it to superscripts, like this:
United States \ 300 million \ 1,2
At any rate, below is the script I came up with to tap into
the
GROUP_CONCAT function. All the data in my table displays
correctly,
except that it now displays no notes (ID_Note) at all. Thanks
for any tips.
SELECT CP.ID
, CP.ID_Name
, CP.Pop
, CP.Pop2
, CP.AgeMed
, CP.Age0
, CP.Age15
, CP.Age65
, CP.Sex
, CP.LifeExp
, CP.PopGrowth
, CP.LitTotal
, GG.IDArea, GG.Name
, DT.ppl_notes
FROM cia_ppl CP
LEFT JOIN gw_geog GG ON GG.IDArea = CP.ID_Name
LEFT OUTER JOIN (
select ID_Name
, GROUP_CONCAT(ID_Note) as ppl_notes
from cia_notes
where Cat = "Ppl"
group
by ID_Name
) as DT
ON DT.ID_Name = CP.ID_Name
WHERE CP.Pop != 0
and CP.ID_Name != 'ear'
AND CP.ID_Name != 'eru'
GROUP BY GG.Name
ORDER BY CP.ID
www.geobop.org - Family Websites
www.invisible-republic.org - Adult political websites (Mature
adults only)this prod_id to the prim key.
-----------^^
"Field 'prodid' doesn't have a default value"
-------------^
Typo?
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"Deon H" <[email protected]> wrote in message
news:[email protected]..
> Hi there. (I know this is propably not the right forum
to ask here, but
> the other forums don't help a lot. Please help me.)
>
>
>
> I have been using phpMyAdmin for a couple of years now
and simply love
> it.
> I have just created a new DB with 6 fields of which the
1st one is
> named: prod_id.
> type: smallint
>
> The rest of the fields are the default settings as
usual. I have changed
> this prod_id to the prim key.
>
> For some reason which I cannot figure out why, does not
show under
> "extra" as "auto_increment".
>
> I have double chacked the other db's I have created
exactly as I have
> done this one, and there is says "auto_increment".
> When I now try to add a record to the DB, I get this
error: "Field
> 'prodid' doesn't have a default value"
>
> Please advise where I am doing something wrong.
>
> Sincere regards,
> Deon -
GROUP_CONCAT is it the answer?
OK I Have a table in a MySQL database which stores results from rugby matches.
I have the following query:
SELECT LeagueTeam_0.TeamName AS TeamName_1, LeagueTeam.TeamName, LeagueResult.LeagueID, LeagueResult.SeasonID, LeagueResult.hscore, LeagueResult.ascore, LeagueResult.LRDate
FROM ((LeagueResult LEFT JOIN LeagueTeam ON LeagueTeam.LeagueTeamsID=LeagueResult.hteam) LEFT JOIN LeagueTeam AS LeagueTeam_0 ON LeagueTeam_0.LeagueTeamsID=LeagueResult.ateam)
That gives this result:
I would only like th date to appear on a single record so I can lay out the results like so
05-09-2009
Ilkley 41 3 Harlepool
Morpeth 31 35 Gateshead
Percy Park 43 22 Driffield
etc.
12-09-2009
Ilkley 38 24 Old Brodleians
Hartlypool 17 22 Morpeth
etc.
I have heard that GROUP_CONCAT will do this but I'm not sure how or if it even works in Dreamweaver 8.
Any help would be appreciatedThanks for you help on this David
I want to use a table for the final layout so I have set up the following simple test to get this working
I am using a Recordset called Recordset2 and have incorporated your code (in blue) into my repeat region but I get the following message
Parse error: syntax error, unexpected $end in /home/driffiel/public_html/TESTER2.php on line 69
Here is the markup with repeat region:
<body>
<table width="240">
<?php do { ?>
<tr>
<td colspan="4"><?php if (!isset($prevDate) || $row_Recordset2['LRDate'] != $prevDate) {
echo $row_Recordset2['LRDate'];
?></td>
</tr>
<tr>
<td><?php echo $row_Recordset2['TeamName']; ?></td>
<td><?php echo $row_Recordset2['hscore']; ?></td>
<td><?php echo $row_Recordset2['ascore']; ?></td>
<td><?php echo $row_Recordset2['TeamName_1']; ?></td>
<?php $prevDate = $row_Recordset2['LRDate']; ?>
<?php } while ($row_Recordset2 = mysql_fetch_assoc($Recordset2)); ?>
</tr>
</table>
</body> -
GROUP_CONCAT equivalence in Oracle
Hello All, I have this table from the MySQL Database and willing to transform it in Oracle. How can I go about it? I am supporting developers who need it to move ahead. Thanks for any input.
SELECT * FROM ( SELECT a.employee_id , a.emp_firstname ,
a.emp_lastname , a.emp_middle_name , LPAD(a.emp_number, 4, 0) , a.work_station ,
c.jobtit_name , CONCAT(CONCAT(a.emp_firstname, ' '), a.emp_middle_name) || CONCAT(' ', a.emp_lastname) ,
d.title , e.estat_name , GROUP_CONCAT(g.emp_firstname, ' ', g.emp_lastname ORDER BY
erep_reporting_mode ) AS Supervisor FROM ( ( ( ( ( hs_hr_employee a LEFT JOIN hs_hr_job_title
c ON ( a.job_title_code = c.jobtit_code ) ) LEFT JOIN hs_hr_compstructtree d ON
( a.work_station = d.id ) ) LEFT JOIN hs_hr_empstat e ON ( a.emp_status =
e.estat_code ) ) LEFT JOIN hs_hr_emp_reportto f ON ( a.emp_number =
f.erep_sub_emp_number ) ) LEFT JOIN hs_hr_employee g ON ( f.erep_sup_emp_number =
g.emp_number ) ) WHERE (a.emp_status != 'EST000' OR a.emp_status IS NULL) GROUP BY
a.emp_number ORDER BY a.employee_id ASC) AS subsel where a.employee_id between 0 and 50;
Regards,Please, I have got some more info on the aggregation here. The main problem is that what I have seen so far aggregate data from 2 tables which don't have any common column and the comparison on the retrieval is made through the equality between 2 columns from 1 table and 1 column from the other table. Please, I will be waiting for your reply and some suggestions on this.
Kind Regards, -
Hello,
Let's say I have two queues one is for Queries, second for Updates, and I want to simulate workload balance algorithm with following steps:
{Query} is loaded from CSV,analyzed and converted to {Query,ClassifiedSpeed} with SVM classifier.
{Update} is loaded from CSV, analyzed and also classified to {Update,SomeParam} but without SVM.
I'm aggregating {Query,ClassifiedSpeed} by ClassifiedSpeed value in range 30 rows, mayby range unbaunded...
I'm updating order of {Update,SomeParam} by SomeParam, just to optimize update for single table in SQL
Now I want to pick row with update or query by some rules, execute it on database ( inside Bean ) and when it's {Query} i want to
compare {ClassifiedSpeed} with real execution time, that's why I need to communicate with Classifier bean once again.
Anyway I'm a bit lost with concept of that application.
I know how to create almost every step on that list, but I'm not sure how control channels and processors.
For example: I have Queries A, B, C, A, C, C, D ( timeline -> )
That gives me input channel ( grouped and counted set, ordered by Count )
{Query,Count,ClassifiedSpeed}
C, 3, Fast
A, 2, Slow
B, 1, Fast
D, 1, Slow
Now i get updates which are only ordered by some extra param:
{Updatem, SomeParam}
U1, TABLE_FOO
U3, TABLE_FOO
U2, TABLE_XXX
the thing is that when I connect both streams into one bean via processors, collect length of queries for statistics, and retrain
SVM if percent of classified event's is lower then expected. So I need to be able to say to processor of aggregates Queries:
Give me best aggregated row, the same to Update: Give me set of updates ( list of events in input here, I know how to handle that ),
but CEP application is based on evens starting from flow order. I need to have working buffers which should be able to give me some
data only when I want.
What Is also important for me: I need to collect "Quality of Data" it's relation between on timestamp and correlation of single rows in
both queues. It's like: Give me number of rows starting from timestamp of Single Query, which are older and affects the same table'
I'm not sure how can I count it when I aggregate queries for processing.
Some extra quesion: Is there possibilty to aggregate ids of queries in CQL? I know that I can do that type of things in SQL (eg. mySQL GROUP_CONCAT )
From data :
101, AAA
102, BBB
103, CCC
104, AAA
105, AAA
106, CCC
it's possibile to get two columns, where "|" is just separator of ids in single string parameter
AAA,101|104|105
BBB,102
CCC,103|106
Bye.Ok. I'm one step closer to understand how can use CEP. I spent 15 minutes on reading 12th chapter ( it's 4.30 AM ;) ) and I think I know how to store results but it still seems to be a bit mad solution for me.
Let's go back to example, which is closer to my task :
SELECT Query, QueryHashCode, QueryOrderNumberInStream, COUNT( QueryHashCode ) AS CountOfDuplictesInQueue
FROM Stream[RANGE 20.../ still not sure/ ]
GROUP BY QueryHashCode,Query, QueryOrderNumberInStream
ORDER BY CountOfDuplictesInQueue DESC, QueryOrderNumberInStream ASC;
.. bean processing.
Classification here of before first select.
Query,
QueryHashCode,
QueryPredictedSpeed ( 1 - 3 ),
QueryLength ( 0 - 5000 ),
CountOfDuplictesInQueue ( 0 - 1000 )
Data :
Query = "SELECT * FROM foo ";
QueryHashCode = 312321; //. Query.hashCode();
QueryPredictedSpeed = 3;
QueryLength =18;
CountOfDuplictesInQueue=2
Now I'll use processor to count something similar to :
SELECT Query, ( QueryPredictedSpeed /CountOfDuplictesInQueue + 0.001*QueryLength) AS some_order
FROM foo [ .. ROW 1 ]
and here is new issue :
When I put it into cache I'll have to define timeout etc. and keep just one row in cache because new rows can modify order ( COUNT () )
so it's a bit sick stuff for me to build few components structure for one row?
1. When I Group few rows in CQL are they going to be removed from stream? I guess Yes.
2. I think that processor will input data into stream in loop so it's also doesn't make sens when we are overwriting row which is not processed.
3. Cleaning cache each time is madness for me ;)
R. -
I have a recordset which produces the following output from a
mysql db:
record1 - Car1 - Ford - Fiesta
record2 - Car1 - Colour - Blue
record3 - Car1 - Price - 2995
recordx - Car2 - VW - Golf
recordy - Car2 - Colour - Red
recordz - Car2 - Price - 4995
I want to write an sql statement which combines all the rows
relevant to each vehicle and output them in the same row e.g.:
Record1 - Car1 - Ford - Fiesta - Blue - 2995
Recordx - Car2 - VW - Golf - Red - 4995
Thanks for any assistance.oO(bikeman01)
>I have a recordset which produces the following output
from a mysql db:
>
> record1 - Car1 - Ford - Fiesta
> record2 - Car1 - Colour - Blue
> record3 - Car1 - Price - 2995
> recordx - Car2 - VW - Golf
> recordy - Car2 - Colour - Red
> recordz - Car2 - Price - 4995
This looks a bit strange and not like a proper DB design. Can
you post
some table details (the CREATE statement)?
> I want to write an sql statement which combines all the
rows relevant to each
>vehicle and output them in the same row e.g.:
>
> Record1 - Car1 - Ford - Fiesta - Blue - 2995
> Recordx - Car2 - VW - Golf - Red - 4995
With a better DB design it would be as simple as
SELECT
id, brand, type, color, price, ...
FROM
For your current table a GROUP_CONCAT clause might help. See
the MySQL
manual for details.
Micha -
How to use "SESSION_kt_email" in my CFC..?
Can someone show me the correct way to reference a Session variable called "SESSION.kt_email" and filter it out of my User_email list?
- The CFC below is used to grab all of the correct emails, but "exclude" the email of the logged in user
- I'm using the GROUP_CONCAT so the outputted emails are separated by commas
- My CFC works fine until I add in the Session stuff, then I get this error..
Here is the CFC email_actions_updated.cfc:
<!--- Generated by Adobe Dreamweaver CS4 10.0.0.4117 [en] (Win32) - Thu Dec 20 2012 16:57:12 GMT-0600 (Central Standard Time) --->
<cfcomponent>
<cffunction name="GetEmails" access="remote" returnType="any" output="false">
<cfargument name="id" type="numeric" required="true">
<cfargument name="kt_email" type="any" required="true">
<!--- GetEmails body --->
<!--- Create Filtered Email list --->
<cfquery name="rsEmailAction" datasource="care">
SELECT GROUP_CONCAT(NULLIF(User_email, <cfqueryparam cfsqltype="cf_sql_varchar" value="#ARGUMENTS.kt_email#"> )) AS User_email
FROM (
SELECT CONCAT(tblemailaction.uea_User, "@corp.clearwave.com") AS User_email,
tblemailaction.uea_ADSL
FROM tblemailaction, tbltickets, tbltickettype
WHERE tbltickets.ttType = tbltickettype.ttDesc
AND tbltickettype.ttID = tblemailaction.uea_ADSL
AND tblemailaction.uea_Updated = 1
AND ttNum = <cfqueryparam cfsqltype="cf_sql_integer" value="#ARGUMENTS.id#">
) q
</cfquery>
<cfreturn rsEmailAction>
</cffunction>
</cfcomponent>
Here is my sample calling page:
<cfparam name="URL.id" default="40865">
<!--- Create Filtered Email list and just send Email to flagged Users --->
<cfinvoke
component="CRM.CTS.email_actions_updated"
method="GetEmails"
returnvariable="rsEmailAction"
id="#URL.id#">
<head>
</head>
<body>
<input name="email_list" type="text" id="email_list" value="<cfoutput>#rsEmailAction.User_email#</cfoutput>" size="150" />
</body>Dan, that helped to point to the problem and the error on my cfc.. I had indeed changed the cfc since my first post and inserted the word "Session" to my Argument as below..
SELECT GROUP_CONCAT(NULLIF(User_email, <cfqueryparam cfsqltype="cf_sql_varchar" value="#ARGUMENTS.Session.kt_email#"> )) AS User_email
I changed the #ARGUMENTS.Session.kt_email# to just #ARGUMENTS.kt_email# and it now returns the correct results!
Thanks to both you and BKBK
ps: you must live in these forums..? -
Hi,
I am using a cfgrid to display a list of pending orders. It
was all working until I modified the query to include some
additional information.
Here is the query that works:
SELECT o.orderid,DATE_FORMAT(o.orderdate,'%d/%m/%Y') as
odate,CAST(o.ordertotal AS CHAR) as
ordertotal,c.firstname,c.lastname, (SELECT CASE pt.producttype WHEN
'POM' THEN 'Required' END AS IsPOM
FROM ordercontents oc, products p, producttype pt
WHERE oc.productid = p.productid
AND p.prodtypeid = pt.prodtypeid
AND o.orderid = oc.orderid
ORDER BY IsPOM DESC LIMIT 1) as IsPOM, (SELECT
GROUP_CONCAT(prd.shortname ORDER BY prd.shortname SEPARATOR ' | ')
FROM products prd,ordercontents oco
WHERE oco.productid = prd.productid
AND o.orderid = oco.orderid) as ordereditems
FROM orders o, customer c
WHERE o.customerid = c.customerid
AND o.statusid = 1
ORDER BY o.orderdate DESC
and here is the query that works but doesn't populate the
cfgrid:
SELECT o.orderid,DATE_FORMAT(o.orderdate,'%d/%m/%Y') as
odate,CAST(o.ordertotal AS CHAR) as
ordertotal,c.firstname,c.lastname, (SELECT CASE pt.producttype WHEN
'POM' THEN 'Required' END AS IsPOM
FROM ordercontents oc, products p, producttype pt
WHERE oc.productid = p.productid
AND p.prodtypeid = pt.prodtypeid
AND o.orderid = oc.orderid
ORDER BY IsPOM DESC
LIMIT 1) as IsPOM, (SELECT
GROUP_CONCAT(CONCAT(prd.shortname,' x ',oco.quantity) ORDER BY
prd.shortname SEPARATOR ' | ')
FROM products prd,ordercontents oco
WHERE oco.productid = prd.productid
AND o.orderid = oco.orderid) as ordereditems
FROM orders o, customer c
WHERE o.customerid = c.customerid
AND o.statusid = 1
ORDER BY o.orderdate DESC
This is the bit that seems to break the cfgrid:
GROUP_CONCAT(CONCAT(prd.shortname,' x ',oco.quantity) ORDER
BY prd.shortname SEPARATOR ' | ')
whereas this works:
GROUP_CONCAT(prd.shortname ORDER BY prd.shortname SEPARATOR '
| ')
notice the addition of the ,' x ', oco.quantity in the query
that doesn't work.
The text that this GROUP_CONCAT spits out is like this:
product1 x 2 | product2 x 42
If I run both versions of the query in the RDS query viewer I
get results showing the correct information. The cfgrid however
only populates from the query above.
The cfdebug shows no errors and shows that both queries
return the same number of records. But the broken version does seem
to get stuck at the ordereditems value which should be just a
string (see above) from cfgrid's point of view.
By the way, I am using MySQL 5 with the built in MySQL driver
for CF8 (hotfix 2).
Cheers,
DaveJust for info. I fixed it by using CAST to force it to a CHAR
datatype:
CAST((SELECT GROUP_CONCAT(CONCAT(prd.shortname,' x
',oco.quantity) ORDER BY prd.shortname SEPARATOR ' | ')
FROM products prd,ordercontents oco
WHERE oco.productid = prd.productid
AND o.orderid = oco.orderid) as CHAR) as ordereditems
Cheers,
Dave -
CF - Mysql communication problem?
I'm getting this error from a query that works fine when used
directly with MySQL
But under CF it throws an error, and I suppose that is
something that Cf is doing, because if I copy the SQL query thrown
from the error , it still works fine.
==============
Error Executing Database Query.
You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to
use near 'select b.id_article, group_concat( c.name order by c.use
The error occurred in D:\Hosting\flammen\myCFC\article2.cfc:
line 5
Called from D:\Hosting\flammen\article\article2.cfm: line 5
Called from D:\Hosting\flammen\myCFC\article2.cfc: line 5
Called from D:\Hosting\flammen\article\article2.cfm: line 5
3 : <cffunction name="ListArticles" access="remote"
returntype="query">
4 : <cfargument name="dsn" type="string"
required="yes">
5 : <cfquery name="qListArticles" datasource="#dsn#">
6 : select a.id_article, a.title, u.users, t.tags
7 : from articles as a
SQL select a.id_article, a.title, u.users, t.tags from
articles as a left outer join ( select b.id_article, group_concat(
c.name order by c.user separator ', ') as users from articlexuser
as b inner join users as c on c.id_user = b.id_user group by
b.id_article ) as u on u.id_article = a.id_article left outer join
( select d.id_article, group_concat( e.tag order by e.tag separator
', ') as tags from articlextags as d inner join tags as e on
e.id_tag = d.id_tag group by d.id_article ) as t on t.id_article =
a.id_articleadd the argument before the </cffunction>
<return qListArticles> -
Blob is a diablo??
Hello,everyone
I am using EL expression and found big problem which has been troubling since this morning!
I use the sql like:
SELECT path,formats,create_time,name,GROUP_CONCAT(tag_name) FROM...
Take action there is a GROUP_CONCAT( ) function in MySQL, which returns a Blob field in the resultSet, you know.That's the root of this tough problem.
I found EL expression cant display field which is a Blob type. The part of Latina characters (iso8859-1) can be shown prefectly,but the part of Chinese which is not iso8859-1 cant be shown correctly. They will be a square instead.
So could you help me out?Have you any expriences in this problem?
Some workmate advise me to use scriptlet to reslove it... It really works!
But if EL expression can also reslove this problem, I 'd rather to use it firstly...
Thank you reading these above patiently...
And best regards to you!up!
-
Hi
Does the express version (11.2) support listagg / wm_concat / Group_concat ?
Thanks
Russellyes/no/no:
SQL> select * from v$version;
BANNER
Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for 32-bit Windows: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
SQL> select region_id, listagg(country_name,' ') within group (order by country_name) as countries
2 from countries
3 group by region_id;
REGION_ID COUNTRIES
1 Belgium Denmark France Germany Italy Netherlands Switzerland United Kingdom
2 Argentina Brazil Canada Mexico United States of America
3 Australia China India Japan Malaysia Singapore
4 Egypt Israel Kuwait Nigeria Zambia Zimbabwe
SQL> select region_id, wm_concat(country_name,' ') as countries
2 from countries
3 group by region_id;
select region_id, wm_concat(country_name,' ') as countries
ERROR at line 1:
ORA-00904: "WM_CONCAT": invalid identifier
SQL> select region_id, group_concat(country_name,' ') as countries
2 from countries
3 group by region_id;
select region_id, group_concat(country_name,' ') as countries
ERROR at line 1:
ORA-00904: "GROUP_CONCAT": invalid identifier
SQL> -
Conditional Group_Concat_D with IF
Can anyone help me out here.
Trying convert a mysql conditional group_concat to TSQL GROUP_CONCAT_D (IF statement)
$view = $view." , GROUP_CONCAT(if(catalogitem_meta_attributeName ='".$catalogitem_meta_attribute->getcatalogitem_meta_attributeName()."', catalogitem_meta_valueRawValue, NULL)) as '".$title."'
TSQL appears to have an issue with using IF
I am using the GROUP_CONCAT_D aggregate in TSQLYou can kludge this violation of First Normal Form with loops, recursive CTE, or XML. Do not write crap code like that
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL
Maybe you are looking for
-
Does anyone have any help for installing Creative Cloud on a MacBook Pro running Parallels Desktop and Windows 8.1? I downloaded the app, double-clicked it, said yes to allowing it to change my system, and received a notice of installation failure wi
-
I lose all my iTunes settings everytime I restart iTunes.
For example, go to Edit Menu -> Open Preferences -> Check 'Group compilations when browsing' -> Save settings -> Save iTunes -> Restart iTunes after settings have been saved (can take a couple of minutes -> Go to Edit Menu -> Open Preferences -> 'Gro
-
FacetSearchTools.facets
Hi all, am working ipad application in ATG 10.1.0, facing a problem, didn't get the array of FacetSearchTools.facets. in crs its working. in adapter module its not working. In ATG10.0.3 its working both crs and ipad application, after migration to AT
-
Disk utility used up my hard drive space?
I recently had a hard drive crash and was trying to repair it with disk utilities. I had the bad drive in an external drive case hooked up to my Macbook Pro via usb. During the process Disk Utility used about 20 GB of drive space on the internal dr
-
Does my iPhone 4 work with Hands Free Profile (HFP)?
My new car is supposed to send/receive text messages via the new fandangled stereo/navigation unit. The manual says the phone must be compatible with "Hands Free Profile (HFP)" or Message Access Profile (HFP)". Does the iPhone4 use/have this? New