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 6369523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:48:58+00:00 2026-05-25T00:48:58+00:00

I want to implode a query result using , inside my mysql stored procedure.

  • 0

I want to implode a query result using "," inside my mysql stored procedure. How can I do that?

For example,

CREATE DEFINER=`root`@`%` PROCEDURE mysp()

BEGIN

    DROP TABLE IF EXISTS  temp;
    CREATE TABLE temp (ids INT(11) , typeid INT(11));

   INSERT INTO temp SELECT id,typeid FROM table_mine1 ..etc

   INSERT INTO temp SELECT id,typeid FROM table_mine2 ..etc

After this I want to fetch all “ids” from temp table and make it as comma separated.

Because I need to write one another query like this

DELETE FROM main_table WHERE ids NOT IN (comma separated ids of temp table.)

How to implode ids of my temp table using comma?

  • 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-25T00:48:59+00:00Added an answer on May 25, 2026 at 12:48 am

    Have a look at the GROUP_CONCAT function?
    something like:

    SELECT GROUP_CONCAT(id ORDER BY id DESC SEPARATOR ',') FROM temp;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using php and mysql, I have a table subdomains that contains subdomains for my
Quick MYSQL/PHP question. I'm using a not-so-strict search query as a fallback if no
I've been trying to use a PHP integer array for a MySQL query that
here is the code $result=mssql_query($query); while($rows=mssql_fetch_array($result, MYSQL_NUM)) { $subjectcode[] = <tr><td> . implode(</td><td>, $rows)
I am trying to figure out how to put a mysql query result into
want to know why String behaves like value type while using ==. String s1
want to have a Hyperlink-Button in a gridView in which I can display a
I have a PHP search script and I want to highlight the keywords that
First off, I do not want what is in the URL query. I want
I wonder if anyone can help - I want to select a table and

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.