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

  • Home
  • SEARCH
  • 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 9032197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:55:11+00:00 2026-06-16T07:55:11+00:00

Lets say that I have a MySQL table that looks like this : BookTitle

  • 0

Lets say that I have a MySQL table that looks like this :

 BookTitle    Chapter    DateAdded  
  Book1          3       2012-12-15
  Book1          2       2012-12-16 
  Book1          1       2012-12-15
  Book2          2       2012-12-16

I want to show it in HTML so it can look like this :

 Book2      2
 Book1      2,3,1  

Basically I want to get rid of the title of the book if existed! and group all the chapters together and sort them by the date

I was thinking of using Group By but all my experiments did not work. Please give me a solution or an advice. I am able to use PHP and MySQL I am currently using a Smarty template on this project.

  • 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-06-16T07:55:12+00:00Added an answer on June 16, 2026 at 7:55 am

    Actually, you can do this in MySQL. Use GROUP_CONCAT function.

    SELECT BookTitle, GROUP_CONCAT(Chapter) ChapterList
    FROM tableName
    GROUP BY BookTitle
    
    • SQLFiddle Demo

    Other Source

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

Sidebar

Related Questions

Let's say I have a MySQL table that is something like this: software table:
Let's say I have a table that looks like this: Id CheckboxId Selected DateCreated
Lets say I have a table in MySQL called articles, that has a column
Lets say that I have a table A. This table has ID, X_value, Y_value.
I have a mysql table called category Inside this table lets say i have
Lets say i have an array in my mysql row: a:3:{i:1;a:3:{i:0;s:1:1;i:1;s:1:3;i:2;s:1:5;}i:4;a:3:{i:0;s:2:21;i:1;s:2:25;i:2;s:2:29;}i:5;a:1:{i:0;s:2:33;}} It looks like
Let's say I have a mySQL table whose structure is like this: mysql> select
Let's say I have 3 MySQL table. A song db called songs that has
Lets say that I have only DHT (distributed hash table) implemented (in Python), and
Lets say I have a table with some data like the following: ID text

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.