Organizational Research By

Surprising Reserch Topic

Question:mysql GROUP BY vs multiple tables


 

Im not sure how to ask this, but which is better... using GROUP BY or multiple tables.
 
Currently, I have one table that generates lists. It has several columns, one is a list id.
 
Right now this is my query
 
SELECT `listID`, `` 
FROM `acmSongLists` 
WHERE `churchID`='".$thisID."' AND `timeSent` >= DATE_SUB( CURDATE( ) ,INTERVAL 0 MONTH ) 
GROUP BY `listID` ASC
The point of course is to get all items associated with the same listID. Then I pass that ID to another query in order to display my list titles. AKA...
 
SELECT * FROM `acmSongLists` WHERE `listID`='$listID'"
I am curious, Is there a better way of doing this? My other thought was to create two tables, one that holds the general information as well as a unique id (listID) then a second table that holds each item within the list. Then query them respectively. I guess I'd like to know what is the most efficient. Thanks for your thoughts.
asked Sep 13, 2013 in MYSQL by anonymous
edited Sep 12, 2013
0 votes
19 views



Related Hot Questions



Government Jobs Opening


...