Chapter 4 QUERYING AND MODIFYING DATA 195 TABLE
Chapter 4 QUERYING AND MODIFYING DATA 195 TABLE 4.1 THE ARGUMENTS OF THE BASIC SELECT STATEMENT Argument Description All Optional. Returns all rows, whether unique or not. This is the default. Distinct Optional. Selects only unique rows. Column list Required. The name of the column(s) you want to retrieve from the tables or * for all columns. Table list Required. Specifies in which table(s) the columns are stored. In cases of joins, you may have more than one table specified. Where condition Optional. These are conditions that limit the number of rows returned Order By Optional. This is a statement that tells how the resultset will be shown. This can be ordered as either ascending (ASC) or descending (DESC). The first portion of the SELECT statement identifies which columns are going to come from table list. When specifying column names, be sure to use a comma-delimited list and don t place a comma after the final column name. When specifying column names, you can use an asterisk (*), designating that all columns are to be returned from the specified table or tables. For example, if you created a table named Product with three columns Product_ID, Name, and Price and selected all columns from this table using the asterisk symbol, your resultset would first display the Product_ID column, then the Name column, and finally the Price column. When the asterisk is not used, however, columns are automatically rearranged in the output based on how you arrange the columns in the column list. Anytime you create a data retrieval query, you have to specify where the data is coming from immediately after you specify which columns you want to access. When specifying table names in the SELECT statement, you may include one or more to collect information from more than one table. For example, examine the following basic query: SELECT au_id, au_fname FROM Pubs.dbo.Authors NOTE Starting to Code Note the naming convention used to supply table names. Four part names, Server.Owner.Database.Object, are discussed in Chapter 3. If the database you are using is already set, then you need not supply the database name or owner name. Before you try any of these examples, make sure the database is Pubs. To do this, type USE PUBS before the first query or select the Pubs database from the drop-down list box at the top of the Query Analyzer.
If you looking for unlimited one inclusive web hosting plan please check web hosting plan website.