Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ MySQL function: group_concat () function     - Build and verify MongoDB3.0.7 version (shard + replica) Cluster (Database)

- CentOS / Linux install VNC Server (Linux)

- Configuring a Linux operating system security management services (Linux)

- How UTorrent download the ISO image from the command line (Linux)

- How to set up FTP server on Linux (Server)

- Why I do not like the Go language style interface (ie Structural Typing) (Programming)

- In addition to wget and curl, what better alternatives (Linux)

- Use SecureCRT to transfer files between local and remote hosts (Linux)

- DRBD installation configuration, working principle and Recovery (Server)

- Into the Java keyword instanceof (Programming)

- Linux gprof oprofiling and performance testing tools (Linux)

- RabbitMQ tutorial examples: RabbitMQ installation under Windows (Linux)

- Linux modify the network interface name (Linux)

- CentOS 6.6 source compiler GCC upgrade to 4.8.2 (Linux)

- MyCAT log analysis (Database)

- About MongoDB query method according to fuzzy field (Database)

- CentOS 6.4 Telecom ADSL dial-up network configuration (Linux)

- Oracle 11g through SCN do incremental backup repair standby library detailed process (Database)

- Python format string (Programming)

- RHEL5 stalled due to power service error system can not start (Linux)

 
         
  MySQL function: group_concat () function
     
  Add Date : 2018-11-21      
         
         
         
  GROUP_CONCAT (expr)
This function will merge non-null column values ​​in accordance with the grouping condition and eventually returned. If a null value is returned is empty, the complete syntax is as follows:
GROUP_CONCAT ([DISTINCT] expr [, expr ...]
            [ORDER BY {unsigned_integer | col_name | expr}
                [ASC | DESC] [, col_name ...]]
            [SEPARATOR str_val])
Example Column 1:
SELECT
    EMP_ID,
    SUM (VALUE1),
    SUM (VALUE2),
    SUM (VALUE3),
    GROUP_CONCAT (REAS_1 SEPARATOR ';'),
    GROUP_CONCAT (REAS_2),
    GROUP_CONCAT (REAS_3)
FROM
    ACT_GP_TEST
GROUP BY
    EMP_ID

Column 2:

SELECT
    EMP_ID,
    SUM (VALUE1),
    SUM (VALUE2),
    SUM (VALUE3),
    GROUP_CONCAT (REAS_1, REAS_2, REAS_3 SEPARATOR ';')
FROM
    ACT_GP_TEST
GROUP BY
    EMP_ID

The above column 1 and column 2 the difference is that the column 2 is the field REAS_1, REAS_2, REAS_3 field one by one as a complete merger.
The maximum length of the receive function group_concat_max_len environment variables defined, it defaults to 1024, of course, can be set higher. At the same time the effective maximum length is returned by the max_allowed_packet constraints.
Group_concat_max_len running is to modify the following syntax:
SET [GLOBAL | SESSION] group_concat_max_len = val;

The result returned is a binary or non-binary character, depending on the value of the function within the field itself. Usually when group_concat_max_len < = 512, in order to VARCHAR or VARBINARY, when the value is greater than the TEXT and BLOB.
     
         
         
         
  More:      
 
- Oracle set the timer task JOB scheduler to execute stored procedures or PL / SQL code block (Database)
- Linux common network tools: traceroute routing of scanned (Linux)
- Nginx DHCP TFTP Kickstart set up automatic installation system (Server)
- A drop datafile Oracle bug (Database)
- CentOS 7 update source - the use of domestic sources 163 yum (Linux)
- Linux shell in back quotes (`) Application (Linux)
- Ubuntu is not in the sudoers file problem solving (Linux)
- MySQL Tutorial: Using tpcc-mysql pressure measurement (Database)
- Install apr support for Tomcat on Linux (Server)
- SteamOS installation under Ubuntu 14.04 (Linux)
- IOS distributed management using GitHub project development (Linux)
- Ubuntu deployed under regular tasks with crontab (Linux)
- ORA-08102 errors (Database)
- CentOS 7 How to connect to a wireless network (Linux)
- 20 Linux commands interview questions and answers (Linux)
- C # Future: Method Contract (Programming)
- Eclipse distributed management using GitHub project development (Linux)
- Docker command Detailed (Linux)
- Linux System Getting Started Learning: The Linux anacron command (Linux)
- Installation and deployment of MariaDB under CentOS (Database)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.