i want to know when execuite a query like "desc TableName" it will return a column name and the column datatype in the order they where in the table even though you execuite different times you will get same order
but if we execuite a query like "select * from TableName" it will return resultset of different order at different times
in both the query we are not using any order by statement i want to know what makes desc statement resultset consistenet
regards amir
Paul Campbell
Ranch Hand
Joined: Oct 06, 2007
Posts: 338
posted
0
Originally posted by Amirtharaj Chinnaraj: hi guys
i want to know when execuite a query like "desc TableName" it will return a column name and the column datatype in the order they where in the table even though you execuite different times you will get same order
but if we execuite a query like "select * from TableName" it will return resultset of different order at different times
in both the query we are not using any order by statement i want to know what makes desc statement resultset consistenet
regards amir
You are confusing the describe a table (DESC TableName) statement with the descending key word used in an order by clause. You will get the same result if you execute DESCRIBE TableName as you do with Desc TableName. Its purpose is to give you information about your table's make-up... it isn't intended to provide a result set. [ October 24, 2007: Message edited by: Paul Campbell ]
Amirtharaj Chinnaraj
Ranch Hand
Joined: Sep 28, 2006
Posts: 215
posted
0
well paul
let me expalin my doubt clearly ,iam using mysql database i use jdbc to connect with database
when i execute a select query without order by statement i get different ordered resultset at different times
but when i execute a describe query i get the resultset with the same order for n number times what makes desc to be consistent
if i want to oder the resultset of a describe query how can i do it for mysql
regards amir
Paul Campbell
Ranch Hand
Joined: Oct 06, 2007
Posts: 338
posted
0
You can't order the information returned from a describe table statement. The statement/command is for providing information about the columns of the table. It shows the column names, the type / size and scale (if applicable) and other useful information.
DESCRIBE table_name
However, you can do describe output select * from table_name ordered by... [ October 25, 2007: Message edited by: Paul Campbell ]