Is there a problem with the way SQL statements are written?
SELECT * FROM [select * from Xf_art where flag=3 order by add_time Desc] A, (SELECT ID userid,username from XF_USR where FL ag!=9) u where a.xfuid=u.userid order BY a.add_time Desc
The above SQL statement is a colleague I have left to write, run normal, but how to feel a bit awkward, SQL statement Such writing is there a problem? Where is the problem (I can't say it now, so I'll ask you)
------Solution--------------------
The statement is no problem, the efficiency may have some problems, check with explain.
SQL Code
Explain select * FROM [select * from Xf_art where flag=3 order by add_time Desc] A, (SELECT ID userid,username from XF_USR where flag!=9) u where a.xfuid=u.userid order BY a.add_time Desc
------Solution--------------------
No problem, from a performance point of view, the first order by add_time Desc can be unwanted.
------Solution--------------------
Such SQL statements can be run without problems, but the efficiency of execution is further modified.
He is the select * from Table A, table U where A.xfuid=u.userid;