Here are my results using MySQL 4.1.12 and I honestly don't think this
is right, but can't figure out what to do:
mysql> select id, group_concat(DISTINCT school_enrollment_time_name
SEPARATOR ',') as school_enrollment_time_display from
school_enrollment_time group by id;
+----+--------------------------------+
| id | school_enrollment_time_display |
+----+--------------------------------+
| 1 | spring |
| 2 | summer |
| 3 | fall |
+----+--------------------------------+
3 rows in set (0.00 sec)
mysql> select id, school_enrollment_time_name from
school_enrollment_time;
+----+-----------------------------+
| id | school_enrollment_time_name |
+----+-----------------------------+
| 1 | spring |
| 2 | summer |
| 3 | fall |
+----+-----------------------------+
3 rows in set (0.00 sec)
I need help in a hurry on this one, thanx
Phil 2 1693
<ph**************@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com... Here are my results using MySQL 4.1.12 and I honestly don't think this is right, but can't figure out what to do:
mysql> select id, group_concat(DISTINCT school_enrollment_time_name SEPARATOR ',') as school_enrollment_time_display from school_enrollment_time group by id;
You're grouping by id, which I assume is a unique key.
So the groups are all guaranteed to be groups of exactly one row.
GROUP BY is traditionally used on fields in which values occur multiple
times.
Regards,
Bill K.
Bill Karwin wrote: <ph**************@gmail.com> wrote in message news:11**********************@g47g2000cwa.googlegr oups.com... Here are my results using MySQL 4.1.12 and I honestly don't think this is right, but can't figure out what to do:
mysql> select id, group_concat(DISTINCT school_enrollment_time_name SEPARATOR ',') as school_enrollment_time_display from school_enrollment_time group by id; You're grouping by id, which I assume is a unique key. So the groups are all guaranteed to be groups of exactly one row.
id is a unique key, therefore, how will it be done to have a single row
consisting of the following:
if I selected ids (1, 2) then I would see the following string:
spring,summer
if I selected ids (1, 3) then I would see the followings tring:
spring,fall
Etc.
Phil GROUP BY is traditionally used on fields in which values occur multiple times.
Regards, Bill K. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: 4partee |
last post by:
I'm trying to import a csv file with a PHP procedure. However, some of the
lines in the csv file have missing values.
When this command is given to mysql:
insert tablex values...
|
by: phillip.s.powell |
last post by:
SELECT s.id, s.student_first_name, s.student_last_name,
IF(s.student_ethnicity_interest_other IS NOT NULL AND
s.student_ethnicity_interest_other != '',
CONCAT(s.student_ethnicity_interest_other,...
|
by: phillip.s.powell |
last post by:
$if1 = "IF(s.student_ethnicity_interest_other IS NOT NULL AND
s.student_ethnicity_interest_other != '', " .
" CONCAT(s.student_ethnicity_interest_other, ', ',
GROUP_CONCAT(e.ethnicity_name...
|
by: tuco357 |
last post by:
This problem has been vexing me for some time and I thought I should
consult the group....
Often times when writing a php script to handle some mysql DB
transactions, I must write code that...
|
by: gmorris |
last post by:
I am attempting to pull data from multiple tables into a resultset that
I can use as an Excel spreadsheet for reporting. Here is my query so
far:
SELECT b.bug_id,p.realname as 'Assigned'...
|
by: lawrence k |
last post by:
Wierd. Go to this page:
http://www.ihanuman.com/search.php
and search for "yoga"
This query gets run:
SELECT * FROM albums WHERE MATCH(name,description) AGAINST ('yoga')
ORDER BY id DESC
|
by: rizwan6feb |
last post by:
I have created a table (with only 2 fields) with the following query
"CREATE TABLE `users` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`name` VARCHAR( 20 ) NOT NULL
) ENGINE = MYISAM ;"
...
|
by: Guillermo Antonio Amaral Bastidas |
last post by:
Hi everybody,
I have a quick and probably dumb question, keep in mind I just
dumped my old love FastCGI + Perl for it's younger hotter friend PHP5.
If the user calls a time consuming script...
|
by: bilibytes |
last post by:
Hi,
I'm wondering how to achieve the following:
well i don't know if you guys like wine but I have to explain a very little on wine to explain my example: Wine is made from grape and a wine...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |