473,810 Members | 3,102 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Return Multiple Rows In A String

3 New Member
Hi All,

I need help on how to return the rows in one particular field as a string with comma separated in
between those data. For example:

Table A

ID Name IsActive
_______________ _______________ _________

1 Amy 1
2 Anne 0
3 Del 0

How do i return resultset like this :

Amy(Active),Ann e,Del

Can we use Concat function in this case?Really hope anyone can give some idea.
Apr 10 '08 #1
4 3919
yasmine
65 New Member
Hi All,

I need help on how to return the rows in one particular field as a string with comma separated in
between those data. For example:

Table A

ID Name IsActive
_______________ _______________ _________

1 Amy 1
2 Anne 0
3 Del 0

How do i return resultset like this :

Amy(Active),Ann e,Del

Can we use Concat function in this case?Really hope anyone can give some idea.


Hi
You can do this by 2 ways.

1. use implode() function of php.
2. use group_concat() function in mysql.

your problem is already discussed here.
Refer the thread Comma Separated which is in MySQL forum.

Thanx n Regards
Yas...
Apr 11 '08 #2
zergziad
3 New Member
Hi
You can do this by 2 ways.

1. use implode() function of php.
2. use group_concat() function in mysql.

your problem is already discussed here.
Refer the thread Comma Separated which is in MySQL forum.

Thanx n Regards
Yas...
Hi Yas, thanx for the idea,my problem solved already. For your information,im using asp.net 2.0 not php and i've used to append character using stringbuilder function provided in asp.net (",)
Apr 14 '08 #3
mwasif
802 Recognized Expert Contributor
GROUP_CONCAT() is a MySQL function.
Apr 14 '08 #4
ronverdonk
4,258 Recognized Expert Specialist
GROUP_CONCAT() is a MySQL function.
And available only with MySql version 4.1 and above.

Ronald
Apr 16 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
1776
by: D. Shane Fowlkes | last post by:
This may be a very basic question but it's something I've never done before. I've looked at a couple of my favorite sites and books and can't find an answer either. I can write a Function to return a single value. No big deal. But I want to call a Function from another Sub and the function finds and returns an entire db record. Using ASP.NET (VB!), how can this be done and how can I differentiate between the fields/columns? For...
1
2927
by: sneha123 | last post by:
There will be some 20 questions and for each question there will be 4 choices.what i want to do is to select multiple answers by clicking the checkbox. i m using asp.net,vb.net pls help me we have written the code using radio button for selecting single item.but we want to replace it with checkbox to select multiple items. the code using radio button is given below .pls correct it with checkbox
0
2015
by: Patrick.O.Ige | last post by:
I have a datagrid with checkboxes.. When a user clicks one check box and clicks the delete button it deletes that ROw. There another situation when a user clicks multiple rows so i had to loop throug the rows like so:- foreach (DataGridItem i in DataGrid1.Items) { CheckBox deleteChkBxItem = (CheckBox) i.FindControl ("DeleteRow"); if (deleteChkBxItem.Checked) {
11
27437
by: Tim Frawley | last post by:
I need to return a DataRow or the Row Index in a DataSet wherein the value I am attempting to find is not a primary key. I have to do this often, more than 200 times when importing a file so it needs to be fast. Could I use a Dataview to filter for the value (which is unique) and return either the DataRow object so I can modify it and put it back into the DataSet the view is based on or somehow get the RowIndex in the DataSet that the...
4
3756
by: Dave Edwards | last post by:
I understand that I can fill a datagrid with multiple queries, but I cannot figure out how to fill a dataset with the same query but run against multiple SQL servers, the query , table structure and username, password etc will be exactly the same for each server, the only thing that will change is the server name. Idealy I would like to get the server names from a seperate dataset so there could be any number of servers, allthough in...
1
1132
by: Kevin Murphy | last post by:
This is probably a stupid question, but ... I'd like to be able to take an existing query and modify it to return a single row if that's what the base query returns, and 0 rows if the base query returns multiple rows. Similarly, I'd like to also modify it to return multiple rows if that's what the base query returns, and 0 rows if the base query return a single row. What's a good way to do this?
0
3665
by: c0dergirl | last post by:
This c# program allows you to select multiple items from a listbox. For each selected item, a worksheet is created in the workbook with some information. Right now I create a chart that plots some information from one of the sheets. What I want to do is have a line on the graph for every sheet. I assume I use multiple datasources to do this, but I don't know how to use the SeriesCollection class to accomplish this. Here's my code....
3
2971
by: weird0 | last post by:
The given should return A,B that is two rows because both accountnames A and B have the same user_Id=1 but it is only returning A when I performed the op. MessageBox.Show("AccountNames:" + Object.ToString() ); public Object GetAccountNames(string User_Id) { //string AccountNames; Object AccountNames;
1
3073
by: dhyder | last post by:
OK, like the title says my error is Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. I have looked into this a lot, but have not been able to find a solution to it. <%@ Page Language="c#" runat="server" debug="true" %> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.OleDb" %> <script runat="server"> OleDbConnection conn = new...
3
1572
by: gyap88 | last post by:
My search engine in visual basic 2005 has 4 textbox for users to input values, named textbox1,textbox2,textbox3,textbox4. I have a string assigned to each of the textbox named accession,classname,description,proteinseq respectively. Sub accessioncase() Dim accession As String accession = textbox1.Text Dim accessionfound As Boolean = False accession = InputBox("Enter Accession Number.") For i As Integer =...
0
9722
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10124
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6882
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4334
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3863
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.