How to concatenate text from multiple rows into a single text string in SQL Server

Consider a database table holding names, with three rows: Peter Paul Mary Is there an easy way to turn this into a single string of Peter, Paul, Mary?

Can I concatenate multiple MySQL rows into one field?

Using MySQL, I can do something like: SELECT hobbies FROM peoples_hobbies WHERE person_id = 5; My Output: shopping fishing coding but instead I just want 1 row, 1 col: Expected...

Postgresql GROUP_CONCAT equivalent?

I have a table and I'd like to pull one row per id with field values concatenated. In my table, for example, I have this: TM67 | 4 | 32556 TM67 | 9 | 98200 TM67 | 72 | 22300 TM99 | 2 |...

MySQL: Increasing GROUP_CONCAT_MAX_LEN param - any dangers?

Right now, my MySQL server is using the default value of 1024 bytes for the GROUP_CONCAT_MAX_LEN, and I need to increase it. I am aware of the fact it is constrained by the MAX_ALLOWED_PACKET...

Get mySQL MONTH() to use leading zeros?

How do I specify to mySQL's MONTH() function to return '08' instead of 8 in this query? I'd like the sort to work datewise. Currently getting results for date...

Combining rows of queried results by unique identifier?

I have a query that searches through several tables and returns one row for every value in one specific column of one of the queried tables. The table returns multiple rows for one unique...

Getting the max value or combine data for duplicate values

This is linked to my previous Qn Table A: ID Rank Name 1 100 Name1 1 45 Name2 2 60 Name3 2 42 Name4 2 88 Name5 3 50 name6 3 50 name7 Table B: ID FileName 1 fn1...

GROUP_CONCAT equivalent in Django

Say I have the following table called fruits: id | type | name ----------------- 0 | apple | fuji 1 | apple | mac 2 | orange | navel My goal is to ultimately come up with a count of the...

XSLT 1.0: sort unique values with key but with exceptions

I have the following simplified XML structure: <?xml version="1.0" encoding="UTF-8"?> <ExportData> <DataSet> <Tables> <Table> <Rows> <R> ...

CAST to DECIMAL in MySQL

I am trying to cast to Decimal in MySQL like this: CAST((COUNT(*) * 1.5) AS DECIMAL(2)) I'm trying to convert the number of rows in a table (times 1.5) to a floating point number with two digits...

sqlite3 JOIN, GROUP_CONCAT using distinct with custom separator

Given a table of "events" where each event may be associated with zero or more "speakers" and zero or more "terms", those records associated with the events through join tables, I need to produce...

Use GROUP_CONCAT result in IN Clause Mysql

I have a Query which returns comma separated integers like : select GROUP_CONCAT(ids) from table2 now I want to use that result in another query like : select * from table1 where column in...

How to get distinct values on GROUP_CONCAT using Google Big Query

I'm trying to get distinct values when using GROUP_CONCAT in BigQuery. I'll recreate the situation using a simpler, static example: EDIT: I've modified the example to represent better my real...

Error Code: 1055 incompatible with sql_mode=only_full_group_by

I have been having issues switching to an offline version of the Lahman SQL baseball database. I was using a terminal embed into an EDX course. This command runs fine on the web terminal: SELECT...

How to use SQL prepared statement in php pdo

I create prepared statement for sql that give me the right result in mysqlWorkbench, but when I tried to use the same query with php pdo, it returns me an empty Array. So how to use my prepared...

GROUP_CONCAT in Vertica

Suppose we have data something like this: date | campaign | raw | unq ------------+----------+-----+----- 2016-06-01 | camp1 | 5 | 1 2016-06-01 | camp2 | 10 | 1 2016-06-01...

IN mysql function group_concat change separator dynamically

I want to use separator for group_concat() function in mysql.But I want to change the separator dynamically.I mean the separator value is coming from a table and that is different for every...

why is left join so slow in mysql

I am new in programming. A have a query which sometimes works but sometimes doesn't works at all. I mean if the result is not only a row it become too slow. If the result is several hundred rows...

importing db phpMyAdmin - Error Incorrect format parameter

I am trying to import the production mysql db into a local xampp test environment. By connecting to web admin(mozff) and simple exporting sql(never needed anything else).And then go to local...

How to display data only once by using two different tables in codeigniter

I am preparing register that input from date and to date...That display the entries made by the user from date and to date...I want to display voucher no,billdate,qty,amount(present in purchase...

Terraform cycle with AWS and Kubernetes provider

My Terraform code describes some AWS infrastructure to build a Kubernetes cluster including some deployments into the cluster. When I try to destroy the infrastructure using terraform plan...

Azure DevOps pipeline error: Tenant ID, application ID, principal ID, and scope are not allowed to be updated

I try to create SQL Server with ARM on Azure DevOps. Pipeline successfully create SQL Server resource to Azure Portal, but I'm getting strange errors in Azure DevOps. Why this occurs and how to...

specific day of next month on a sql query

I have a complex (complex because it gave me lots of work to complete!) and it returns results that fulfill the query till the day 30 of the current month. Here is the code: SELECT CONCAT('...

How to use Laravel eloquent to select subquery and do UNION?

I have a table counts id | location_id | count | created_at 1 | 25 | 34 | 2020-12-28 02:11:01 2 | 25 | 23 | 2020-12-28 04:11:01 Desired Output hour | sumCount 01:00 0 02:00 34 03:00 0...

BigQuery, How to replicate the 'Conversions | (Enhanced) Ecommerce | checkout behavior' funnel report

I built a query that allows me to replicate the google analytics shopping behavior funnel report in bigquery: #standardSQL select case when totals.newvisits = 1 then 'New visitor' else...

Terraform fails to create a 64-bit Azure App Service (Web app)

I am using terraform version 0.15.5 (and also 0.15.4) to provision an Azure Web App resource. The following configuration works fine: site_config { http2_enabled = true ...

ARM Template - auto approval of managed private endpoint

I am developing an ARM template for Azure Data Factory with managed private endpoints to SQL Server and Azure Datalake. However, when the ARM template completes execution, the managed private...

Aggregate attributes of roles in claims using Keycloak Script Mapper

We have a Keycloak Script Mapper to add attributes of roles to the ID token. The goal is to aggregate the values available in attributes for the roles. The mapper looks like this: /** * Merge...

Mysql capture meta_key as columns

I have a MySQL view (data coming from joined Wordpress Tables) to capture form submission data. The table description looks...

Create view based on stored procedure or create table with it's results

I wrote some code and i want to create view based on it or create table with it results. The problem is that i completely don't have any idea how to do this. The view will be better solution for...