Pardon my lack of SQL knowledge. If I have two tables like this:
weblogs{
id
title
mainContent
}
entries{
id
title
mainContent
belongsToWhichW eblog
}
The last field in entries holds the id of the weblog to which the entry
belongs.
Suppose I want to select the id and title of the weblogs, but I want my
ORDER BY clause to somehow say that the weblogs should be ordered by
how many entries belong to that weblog. If there are two weblogs with
ids 4 and 54 and 4 shows up in belongsToWhichW eblog 23 times and 54
only shows up 12 times, then I want the weblog with the id of 4 to come
first in the ordering.
Is there a way to do that? Mind you, I've a somewhat new version of
MySql in the 3.x series installed, but for various reasons I can not
upgrade to version 4.
weblogs{
id
title
mainContent
}
entries{
id
title
mainContent
belongsToWhichW eblog
}
The last field in entries holds the id of the weblog to which the entry
belongs.
Suppose I want to select the id and title of the weblogs, but I want my
ORDER BY clause to somehow say that the weblogs should be ordered by
how many entries belong to that weblog. If there are two weblogs with
ids 4 and 54 and 4 shows up in belongsToWhichW eblog 23 times and 54
only shows up 12 times, then I want the weblog with the id of 4 to come
first in the ordering.
Is there a way to do that? Mind you, I've a somewhat new version of
MySql in the 3.x series installed, but for various reasons I can not
upgrade to version 4.
Comment