Code:
Well, what _Aerospace_Eng_ was getting at, I believe, is the fact that this statement is at least redundant if not problematic in and of itself:
Code:
SELECT series.* FROM series
You should simply change the series.* to just *
WHY?
There is NO DIFFERENCE AT ALL between
Code:
SELECT series.* FROM series
and
Code:
SELECT * FROM series
None. Not one iota.
There *IS* a difference if you were using mutiple tables:
Code:
SELECT series.* FROM series LEFT JOIN rating ...
Indeed, that would get ONLY the fields from the
series table. Wheras
Code:
SELECT * FROM series LEFT JOIN rating ...
would be the same as doing
Code:
SELECT series.*, rating.* FROM series LEFT JOIN rating ...
Granted that using * is bad, but there is truly ZERO difference between
Code:
SELECT series.* FROM series LEFT JOIN (
select rating.* from rating WHERE rating.USER_USERID=51)
ON series.SERIESID=rating.SERIES_SERIESID
WHERE series.SERIESID=1
and the same code using just * in place of series.* and rating.*
The query is utterly bogus from the get-go because he LEFT JOINs to a sub-SELECT but then his ON clause refers to the ENTIRE rating table!
If he really wanted to use a sub-SELECT, he should have coded:
Code:
SELECT series.* FROM series LEFT JOIN (
select rating.* from rating WHERE rating.USER_USERID=51) AS XXX
ON series.SERIESID=XXX.SERIES_SERIESID
WHERE series.SERIESID=1
But of course it's much better to just do the LEFT JOIN as I showed it.