home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / dbase / acessq_a.zip / WX0639.TXT < prev    next >
Text File  |  1992-10-12  |  6KB  |  99 lines

  1. ======================================================================
  2.   Microsoft(R) Product Support Services Application Note (Text File)
  3.                  WX0639: QUERYING QUESTIONS & ANSWERS
  4. ======================================================================
  5.                                                   Revision Date: 10/92
  6.                                                       No Disk Included
  7.  
  8. The following information applies to Microsoft Access(TM) version 1.0.
  9.  
  10.  --------------------------------------------------------------------
  11. | INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY    |
  12. | ACCOMPANY THIS DOCUMENT (collectively referred to as an            |
  13. | Application Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY      |
  14. | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO    |
  15. | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A     |
  16. | PARTICULAR PURPOSE. The user assumes the entire risk as to the     |
  17. | accuracy and the use of this Application Note. This Application    |
  18. | Note may be copied and distributed subject to the following        |
  19. | conditions: 1) All text must be copied without modification and    |
  20. | all pages must be included; 2) If software is included, all files  |
  21. | on the disk(s) must be copied without modification [the MS-DOS(R)  |
  22. | utility DISKCOPY is appropriate for this purpose]; 3) All          |
  23. | components of this Application Note must be distributed together;  |
  24. | and 4) This Application Note may not be distributed for profit.    |
  25. |                                                                    |
  26. | Copyright 1992 Microsoft Corporation. All Rights Reserved.         |
  27. | Microsoft and MS-DOS are registered trademarks and Microsoft       |
  28. | Access and Windows are trademarks of Microsoft Corporation.        |
  29. | Btrieve is a registered trademark of SoftCraft, Inc., a Novell     |
  30. | Company. dBASE III PLUS and dBASE IV are registered trademarks     |
  31. | of Ashton-Tate Corporation. Paradox is a registered trademark of   |
  32. | Ansa Software, a Borland company.                                  |
  33.  --------------------------------------------------------------------
  34.  
  35. 1. Q. How can I export the result of a query?
  36.  
  37.    A. To export the results of a query, you must create a table that
  38.       contains the results. To do this, create a make-table query in
  39.       Design view (choose Make Table from the Query menu). The
  40.       resultant table will contain the data to be exported. After the
  41.       make-table query is complete, choose Export from the File menu to
  42.       export the data in the desired format. For more information,
  43.       please refer to Chapter 4 of the "User's Guide."
  44.    
  45. 2. Q. Can I join tables from different databases into one query?
  46.  
  47.    A. Yes, you can join tables from different databases into one query.
  48.       Using the Attach Table method, you can generate queries from any
  49.       supported data source (for example, Btrieve[R], dBASE III
  50.       PLUS[R], dBASE IV[R], or Paradox[R]).
  51.  
  52. 3. Q. Is data in tables stored in a sorted order? How can I view
  53.       my data in sorted order?
  54.  
  55.    A. Data in tables is not stored in sorted order. Data is stored in
  56.       the order in which it was entered. To view data in sorted order,
  57.       create either a query or a form based on a query that uses the
  58.       Sort field on the query grid. By default, if the table includes a
  59.       primary key, the Datasheet view of the table will display the
  60.       data sorted by the primary key. To view the data sorted by
  61.       something other than the primary key alone, use a query, as
  62.       previously described.
  63.  
  64. 4. Q. How can I create computed columns in tables?
  65.  
  66.    A. Within the query, create a column that is defined as an
  67.       expression. In general, it is helpful to think of queries as
  68.       virtual tables; you can use a query wherever you can use a table.
  69.       If you're familiar with SQL terminology, this is very similar to
  70.       creating a view. Unlike most implementations of views, however,
  71.       Microsoft Access views can be updated even if they involve joins
  72.       from different data sources, such as Paradox, Btrieve, or
  73.       separate Microsoft Access data sources.
  74.  
  75. 5. Q. What is the difference between the keywords DISTINCT and
  76.       DISTINCTROW?
  77.                                    
  78.    A. DISTINCT is part of the SQL standard and causes a query to return
  79.       unique data, rather than unique records. For example, even if
  80.       there are 10 customers named Jones, the query "SELECT DISTINCT
  81.       Name FROM Customer" returns only one row containing Jones. In
  82.       Microsoft Access queries, you specify DISTINCT by choosing Query
  83.       Properties from the View menu and selecting the Unique Values
  84.       Only check box.
  85.    
  86.       DISTINCTROW is unique to Microsoft Access and is not part of the
  87.       SQL standard. It causes a query to return unique records, rather
  88.       than unique data values. For example, if there are 10 customers
  89.       named Jones, the query "SELECT DISTINCTROW Name FROM Customer"
  90.       returns all 10 rows containing Jones.
  91.    
  92.       The major reason for adding the DISTINCTROW keyword to Microsoft
  93.       Access SQL is to support semi-joins that can be updated (for
  94.       example, one-to-many joins in which the output columns all come
  95.       from the one-side table). DISTINCTROW is specified by default in
  96.       Microsoft Access queries and is ignored in queries where it has
  97.       no effect.
  98.  
  99.