jasongr
01-21-2008, 11:39 AM
Hi,
I need a quick help with a small query.
I have a table that holds association between people and photos like so:
create table people_in_photo (
`Image_ID` int unsigned not null,
`Individual_ID` int unsigned not null,
PRIMARY KEY (`Image_ID`, `Individual_ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
I need to run a query that will return the mapping of the people in the photos ordered by associations.
For example, if person 5 appears in 10 different photos, and person 2 appears in 2 photos, then the associations on person 5 should come before person 2.
The total number rows that will be returned will be the total number of row in the table, as I need ALL the associations (just ordered)
any help would be appreciated
Jason
I need a quick help with a small query.
I have a table that holds association between people and photos like so:
create table people_in_photo (
`Image_ID` int unsigned not null,
`Individual_ID` int unsigned not null,
PRIMARY KEY (`Image_ID`, `Individual_ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
I need to run a query that will return the mapping of the people in the photos ordered by associations.
For example, if person 5 appears in 10 different photos, and person 2 appears in 2 photos, then the associations on person 5 should come before person 2.
The total number rows that will be returned will be the total number of row in the table, as I need ALL the associations (just ordered)
any help would be appreciated
Jason