Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7601725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:14:03+00:00 2026-05-30T23:14:03+00:00

I am using the hxtt sql driver for csv files. It only supports plain

  • 0

I am using the hxtt sql driver for csv files. It only supports plain sql. is there a way to simulate group concat using plain sql statements?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:14:04+00:00Added an answer on May 30, 2026 at 11:14 pm

    How plain? If you can use triggers then you can do it fairly simply. I’ve used this trick before in SQLite3 when I’ve needed a group_concat() that allows me to specify the order in which values are to be concatenated (SQLite3 does not provide a way to do that).

    So let’s say we have a table like this:

    CREATE TABLE t(v TEXT NOT NULL, num INTEGER NOT NULL UNIQUE);
    

    and you want to concatenate the values of v ordered by num, with some separator character, let’s say a comma.

    CREATE TEMP TABLE c(v TEXT);
    CREATE TEMP TABLE j(v TEXT);
    
    CREATE TEMP TRIGGER j_ins BEFORE INSERT ON j
    FOR EACH ROW
    BEGIN
        UPDATE c SET v = v || ',' || NEW.v;
        INSERT INTO c (v) SELECT NEW.v WHERE NOT EXISTS (SELECT * FROM c);
        SELECT RAISE(IGNORE);
    END;
    

    Now we can:

    INSERT INTO j (c) SELECT v FROM t ORDER BY num;
    SELECT v FROM c; -- this should output the concatenation of the values of v in t
    DELETE FROM c;
    

    Finally, this is a sqlite3 session showing that this works:

    SQLite version 3.7.4
    Enter ".help" for instructions
    Enter SQL statements terminated with a ";"
    sqlite> CREATE TABLE t(v TEXT NOT NULL, num INTEGER NOT NULL UNIQUE);
    sqlite> CREATE TEMP TABLE c(v TEXT);
    sqlite> CREATE TEMP TABLE j(v TEXT);
    sqlite> CREATE TEMP TRIGGER j_ins BEFORE INSERT ON j
       ...> FOR EACH ROW
       ...> BEGIN
       ...>     UPDATE c SET v = v || ',' || NEW.v;
       ...>     INSERT INTO c (v) SELECT NEW.v WHERE NOT EXISTS (SELECT * FROM c);
       ...>     SELECT RAISE(IGNORE);
       ...> END;
    sqlite> insert into t (v, num) values (1, 0);
    sqlite> insert into t (v, num) values (31, 1);
    sqlite> insert into t (v, num) values (52, 2);
    sqlite> insert into t (v, num) values (0, 3);
    sqlite> SELECT v FROM c;
    sqlite> INSERT INTO j (v) SELECT v FROM t ORDER BY num;
    sqlite> SELECT v FROM c;
    1,31,52,0
    sqlite> SELECT v FROM j;
    sqlite> DELETE FROM c;
    sqlite> 
    

    Now, this isn’t pure SQL, because it depends on triggers. Between recursive triggers and all the ways to do conditionals in SQL you have a Turing complete system. But if you don’t have triggers, or any procedural extensions, no generator tables… then not so much.

    I know nothing about hxtt, so maybe this won’t help you. But SQLite3 can deal with CSV, so maybe SQLite3 can help you…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
Using online interfaces to a version control system is a nice way to have
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using android 2.3.3, I have a background Service which has a socket connection. There's
Using Tsql, how can I find out when MS SQL server was installed?
Using the RichTextArea in GWT, It looks like I can only change the font
Using intellij and maven pom files, how do i debug tests run inside the
Using SQL Server 2005 Leave Table ID StartDate EndDate 001 02/03/2010 02/03/2010 002 02/03/2010
Using Spring MVC, do interceptors only intercept defined controller mappings or can they also
Using emacs on Ubuntu 11.10. I want to connect to a SQL Server database

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.