Querying multiple tables

Results 1 to 2 of 2

Thread: Querying multiple tables

  1. #1
    Tobias Brandvik Guest

    Default Querying multiple tables

    I have a database with 4 tables. On my mainpage I want to view the last five records in each table. Is it possible to query all the tables at the same time and getting all the records I want in a single recordset (something like SELECT TOP 5 FROM table1 table2 table3...).<BR> <BR>If this is not possible, do I then have to create five recordsets? (Query one table, print results, query another, print results etc..)<BR><BR>Thanks in advance for any help...

  2. #2
    Join Date
    Dec 1969

    Default UNION

    look up the key word UNION in access help or sql server BoL and you&#039;ll find what you need<BR><BR>select top 5 this, that<BR>from table1<BR><BR>UNION<BR><BR>select top 5 this, that<BR>from table2<BR><BR>UNION ... etc etc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts