I have a table structure like :
ID, Test_ID, Verdict, PATH, Last_Status,
Present_status, Remote_location,TestCase
I want the result to be displayed starting with TestCase
But I do not want to mention all the fileds particularly.
Is there anything like
select TestCase,* from Table order by TestCase` ?
Basically the result s开发者_StackOverflow中文版hould be displayed as
Testcase, ID, Test_ID, Verdictm PATH,
Last_Status, Present_statusmRemote_location
If I try the above select, it does not work in MYSQL. Is there any command to achive what I require?
Thanks.
Not that I know of. Even so, it's good practice to avoid using SELECT * FROM tableName
wherever possible.
If your column list ever changes, queries in your code may assign values to the wrong fields.
you have to list all the fields you want in the order you want them in. it is either use * or list what you want, and just for the future using * is bad practice.
yes, just list the columns you want first explicitly in the Select clause:
Select Testcase, t.* From TableName
But the asterisk will cause the testcase column to be output no matter what, so you will get it twice. To avoid ambiguous redundant column names, you will have to alias the first one:
Select Testcase as FirsttestCase, t.* From TableName
精彩评论