通常,当你从一个表中取出字段值时,该值与创建该表时所定义的字段名联系在一起。如果你从表authors中选择所有的作者名字,所有的值将会与字段名au_lname相联系。但是在某些情况下,你需要对字段名进行操作。在SELECT语句中,你可以在缺省字段名后面仅跟一个新名字来取代它。
-Typically, when you retrieve from a table field values, the value and create the table as defined field names linked. If you select the authors from the table all the author
SHOW FULL COLUMNS FROM `jrk_downrecords` [ RunTime:0.001074s ]
SELECT `a`.`aid`,`a`.`title`,`a`.`create_time`,`m`.`username` FROM `jrk_downrecords` `a` INNER JOIN `jrk_member` `m` ON `a`.`uid`=`m`.`id` WHERE `a`.`status` = 1 GROUP BY `a`.`aid` ORDER BY `a`.`create_time` DESC LIMIT 10 [ RunTime:0.075709s ]
SHOW FULL COLUMNS FROM `jrk_tagrecords` [ RunTime:0.000953s ]
SELECT * FROM `jrk_tagrecords` WHERE `status` = 1 ORDER BY `num` DESC LIMIT 20 [ RunTime:0.001065s ]
SHOW FULL COLUMNS FROM `jrk_member` [ RunTime:0.000958s ]
SELECT `id`,`username`,`userhead`,`usertime` FROM `jrk_member` WHERE `status` = 1 ORDER BY `usertime` DESC LIMIT 10 [ RunTime:0.003036s ]
SHOW FULL COLUMNS FROM `jrk_searchrecords` [ RunTime:0.000867s ]
SELECT * FROM `jrk_searchrecords` WHERE `status` = 1 ORDER BY `num` DESC LIMIT 5 [ RunTime:0.003603s ]
SELECT aid,title,count(aid) as c FROM `jrk_downrecords` GROUP BY `aid` ORDER BY `c` DESC LIMIT 10 [ RunTime:0.013897s ]
SHOW FULL COLUMNS FROM `jrk_articles` [ RunTime:0.001053s ]
UPDATE `jrk_articles` SET `hits` = 2 WHERE `id` = 187632 [ RunTime:0.018612s ]