mysql - `ORDER BY` before `GROUP BY` in a request with INNER JOIN? -
In the beginning, create a query to get sites
from a table sorted by the date of the latest code Required for `` `` `` `` `` `` `` `` `` `` `` `` ``> I think that
SELECT
and INNER JOIN
all posts Receive and associate the site for each one by entering ORDER BY
the result posted GROUP BY
Each site and me The necessary results will be found.
But I get the MySQL error # 1064 - there is an error in your SQL syntax; Close group BY
sites . To use
ID LIMIT 0, 30 ', check the manual related to your MySQL server version for the correct syntax. <7> / P>
If I am working with GROUP BY
before ORDER BY
statement, but I The latest for the site Instead, the result will be sorted after followed by which I do not need (in fact I may prefer to order after the group in another way).
I have many very similar questions but they all are related to the data stored in a single table, making it possible to use the MAX
and MIN
functions is.
What I have to do is either a subquery / derivative-table / inline-view or a self-experiment. Joining exclusion, eg:
SELECTs *, A1. * INNER JOIN 'articles' a1 on A1 from sites `` `` `` `Articles 2 '' A '` ```` `` `` `` `` `` `` Task order by "A1.`date` WHERE a2._site_id 'a1.`date` DESC
is that you select those sites for which any article There is no date other article date
Comments
Post a Comment