SELECT * FROM (select A.video_name Name,a.vid,a.pos,a.pic,a.definition,b.app_code,a.strength,a.ad_mark from Access_ App_video A
Left JOIN Access_app b in A.app_id=b.id WHERE tag_interest=2 and App_id=1 and A.ad_mark=1 and A.status=0 ORDER by ABS (tag_ sex-16), ABS (tag_figure-10)) AA
ORDER by Aa.strength DESC LIMIT 0,12
How the subquery changes to a linked table query
Reply to discussion (solution)
SELECT a.video_name Name,a.vid,a.pos,a.pic,a.definition,b.app_code,a.strength,a.ad_mark from access_app_video A left joins Access_app B on A.app_id=b.id WHERE tag_interest=2 and App_id=1 and A.ad_mark=1 and a.status=0 ORDER b Y A.strength, ABS (TAG_SEX-16), ABS (TAG_FIGURE-10) DESC LIMIT 0,12
Thank the 2 floor answer, but this write, the results of the search and the original results are different, the original SQL means first according to ABS (TAG_SEX-16), ABS (tag_figure-10) sort
Then sorted by a.strength, the SQL on the 2 floor changed the collation.
#2
Is the statement not able to use a linked table query?
The end result is to press a.strength descending, when a.strength is simultaneously pressed ABS (TAG_SEX-16), ABS (TAG_FIGURE-10) ascending
Of course, when ABS (TAG_SEX-16), ABS (TAG_FIGURE-10) have multiple sets of the same value, the results will be slightly different
That's why the writer wrote that.
5
Is this, now is to use ORM to write SQL, always thought that all sub-queries can be replaced with a table query, just want to change the query into a table query, think, even the table query seems to solve, can only continue to write