[英]select query with multiple values
I have tbl which consists of date and show timings in that i want to select distinct date from tbl 我有tbl,它由日期和显示时间组成,我想从tbl中选择不同的日期
date | from | time
2013-09-10 9:30 12:30
2013-09-10 12:30 1:00
and the o/p should be 和O / P应为
date | show timngs
2013-09-10 9:30-12-30 | 12:30 -1:00
i tried the sql statement like 我试过像
"SELECT * FROM `shows` WHERE `movid` = '$id' ORDER BY date
and o/pi got is 而o / pi得到的是
2013-09-10 09:00 AM-11:00 AM
2013-09-10 09:00 AM-11:00 AM
how to get in above format help me out 如何获得以上格式的帮助我
Thanks in adance.. 预先感谢..
ameeth 阿米斯
try to group by date : 尝试按日期分组:
SELECT
date,
GROUP_CONCAT(CONCAT(from,'-',time) SEPARATOR ' | ')
FROM
table
GROUP BY
date;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.