answersLogoWhite

0


Best Answer

I'm actually not familiar with Access, but I'll try to help. Usually the primary key will physically order the rows in a database table. In SQL-query you can use "order by" clause. The default order is usually ascending. You can also add "asc" or "desc" after the column name.

Please do notice, primary keys are not for ordering rows. You should really let the database decide how to save the rows. You should always order the rows in your query (if needed), not modify or trust the physical order!

select col1

from foo

order by col2

select col1

from foo

order by col2 desc, col3 asc

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you set up ascending and descending order in a table and a query?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Math & Arithmetic

How would you write SQL query to show avarege number of something?

That's something like: SELECT AVG(column) AS average_value_of_column FROM table;


What methods are there of entering data into a Database?

Data in a database table can be inserted by the help of Data Manipulation Language, by writing query in language like Sql.


How validate and retrieve data from database?

It is better to validate the data going into the database for errors rather then data coming out. The data to be retrieved can be done using the $_REQUEST or mysql_fetch_array or PDO statements. I am giving 2 simple examplesIf you want a particular data that can be obtained by using the where clause


How is and order form the same as a record in a database?

Each Order Form consists of a number of 'Boxes' which are completed to record individual pieces of information about a single order. Each Record in a database order table consists of a number of fields which are used to store individual pieces of information about a single order If you have a filing cabinet filled with lots of Order Forms this is like the Order Table in the database which stores lots of Order Records.


What is sql cartesian product?

Answer:when a join condition is omited when getting result from two tables then that kind of query gives us Cartesian product, in which all combination of rows displayed. All rows in the first table is joined to all rows of second table...Hope this answer helps!Inclus - We provide individual and corporate trainingEducate, Learn & Serve

Related questions

How do you create a query that will display the top five orders in descending order by order total?

To create a query that will display the top five orders in descending order by order total create a select query object. Open the query design table and select the top five orders, then choose to display them in descending order.


What is the name of the field that is in either ascending or descending order and will be searched when a table-lookup is performed?

Index field.


Routing table entries for major networks are stored in blank order whereas entries for subnets within each network are stored in blank order.?

ascending, descending


How do you sort variable in ascending or descending order both in php?

Assuming that the values are stored in an array, you can use the php function sort($array) to sort ascending, and rsort to sort descending. The following link gives a table that lists all of the built in PHP sort functions: http://php.net/manual/en/array.sorting.php


What does it mean to sort a table in ascending order?

To sort from smallest to largest. Ascending means to go up.


What does it mean to sort a data file?

Sort refers to the action wherein the data fetched from a database table is ordered as per a specific criteria. The default order of sort is Ascending and the user can do a descending sort by using the keyword DESC after the order by keyword. Ex: select * from employee_details order by employee_num desc If the above statement is executed data will be displayed in descending order of employee numbers.


What clause should be used to display the rows of a table in ascending order of a particular column?

Order by


What does a sort mean in a database?

Sort refers to the action wherein the data fetched from a database table is ordered as per a specific criteria. The default order of sort is Ascending and the user can do a descending sort by using the keyword DESC after the order by keyword. Ex: select * from employee_details order by employee_num desc If the above statement is executed data will be displayed in descending order of employee numbers.


In GCSS- Army when an ascending or descending sort has been applied to a data table what indicator in the table is used to identify the column of data used to establish the sort?

Not sure


What are the parts of a basic SQL query?

The basic parts of a SQL Select query are: SELECT column names FROM table name WHERE conditions ORDER BY column names The basic parts of an insert query would be: INSERT INTO table name (VALUES) The basic parts of a delete query would be DELETE FROM table name WHERE conditions The basic parts of an update query would be UPDATE TABLE table name SET column name = value WHERE conditions


If you delete query does it delete the original information in the table?

Your question is unclear. If you mean if you delete a query, then it does not affect the data in the table. Deleting any kind of query does not affect the data in any table it uses. If you mean if you run a Delete query, then yes the data in the table will be deleted. That is what Delete queries are for.


Where does the destination table in an Append query show in the query grid?

It does not show in the query grid. On the Append To line you can pick the fields in the destination table that you want values to be appended to. The query grid is just for specifying what fields and records you want to be added to the destination table, so it only needs to show the source table.