group-concat

How to calculate group_concat in codeigniter

人盡茶涼 提交于 2021-01-29 08:02:08
问题 I want to groupconcat product name..but it displaying undefined index product name in my view page..I don't know where i am making mistake..please help me to groupconcat product name.. controller code: $this->db->select('GROUP_CONCAT(prdtname)', false); $this->db->from('purchaseitem'); $this->db->group_by('vno'); $query1=$this->db->get()->row_array(); $data['query1']= $query1; I tried groupconcat in sql on my localhost it gives me an expected result..but i don't know where i had done mistake

GROUP_CONCAT in CodeIgniter

我是研究僧i 提交于 2021-01-29 07:24:31
问题 I'm just blocking to how create my group_concat with my sql request in CodeIgniter. All my queries are listed in a table, using Jtable library. All work fine, except when I try to insert GROUP_CONCAT. Here's my model page : function list_all() { $login_id = $this->session->userdata('User_id'); $this->db->select('p.project_id, p.Project, p.Description, p.Status, p.Thumbnail, t.Template'); $this->db->from('assigned_projects_ppeople a'); $this->db->where('people_id', $login_id); $this->db->join(

Presto equivalent of MySQL group_concat

南笙酒味 提交于 2020-06-09 10:05:08
问题 I'm new to Presto and looking to get the same functionality as the group_concat function in MySQL. Are the following two equivalent? If not, any suggestions for how I can recreate the group_concat functionality in Presto? MySQL: select a, group_concat(b separator ',') from table group by a Presto: select a, array_join(array_agg(b), ',') from table group by a (Found this as a suggested Presto workaround here when searching group_concat functionality.) 回答1: Try using this in place of group

query to return a single row with the multiple items in separate columns within the row

浪尽此生 提交于 2020-02-05 01:51:26
问题 I have a situation where I return results with multiple rows. I'm looking for a way to return a single row, with the multiple items in separate columns within the row. My initial query: SELECT a.name, a.city, a.address, a.abbrv, b.urltype, b.url FROM jos__universityTBL as a LEFT JOIN jos__university_urlTBL as b on b.universityID = a.ID WHERE a.stateVAL = 'CA' My output: | University Of Southern Califor | Los Angeles | | usc | 2 | http://web-app.usc.edu/ws/soc/api/ | | University Of Southern

MySQL group_concat(utf8) in union truncated to 1024/3

半城伤御伤魂 提交于 2020-02-02 06:09:15
问题 TLDR: group_concat(utf8 varchar) union itself returns only group_concat_max_len/3 ASCII characters as if the character length was fixed instead of variable. The group_concat alone returns group_concat_max_len characters as expected. The problem I have a table tabletest with a column data defined as an UTF8 varchar(2048) . There is only a single row in the table with 1050 ASCII characters in the column. A group_concat over this table/column returns 1024 characters (equals group_concat_max_len

MySQL group_concat(utf8) in union truncated to 1024/3

一世执手 提交于 2020-02-02 06:08:34
问题 TLDR: group_concat(utf8 varchar) union itself returns only group_concat_max_len/3 ASCII characters as if the character length was fixed instead of variable. The group_concat alone returns group_concat_max_len characters as expected. The problem I have a table tabletest with a column data defined as an UTF8 varchar(2048) . There is only a single row in the table with 1050 ASCII characters in the column. A group_concat over this table/column returns 1024 characters (equals group_concat_max_len

MySQL group_concat(utf8) in union truncated to 1024/3

一笑奈何 提交于 2020-02-02 06:07:09
问题 TLDR: group_concat(utf8 varchar) union itself returns only group_concat_max_len/3 ASCII characters as if the character length was fixed instead of variable. The group_concat alone returns group_concat_max_len characters as expected. The problem I have a table tabletest with a column data defined as an UTF8 varchar(2048) . There is only a single row in the table with 1050 ASCII characters in the column. A group_concat over this table/column returns 1024 characters (equals group_concat_max_len