Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP Search Access DB 1

Status
Not open for further replies.

ukwebsite

Programmer
Dec 9, 2000
82
GB

Please help

How do I tell the SQL statment to use all tableas without writing them.

For example

SELECT * FROM *

Thanks
Matthew Wilde
matthew@ukwebsite.com
 
Matthew,

I don't believe that can be done but it is a SQL question so you might want to ask it in one of the Tek-Tips SQL forums.

Good luck
-pete
 
The statement to search multiple tables is UNION but you still have to tell it which tables to search.

Mark

 
Please can you supply an example of how this "UNION" is used?

Cheers
Matthew Wilde
matthew@ukwebsite.com
 
Here's something I found on the web.

Mark


UNION adds the result of a second SELECT clause to the table created by the main SELECT command. With the UNION clause, each SELECT must result in the same number of output columns and each column must correspond in type. The first SELECT command determines the names and the types of the output columns. Numeric variables must correspond to numeric variables, string variables with string variables.
The main SELECT command defines the table that is produced when using the UNION statement. For example, assume two tables, one for current employees and one for ex-employees. A single output table for all employees could be produced with the UNION clause:


SELECT NAME SALARY FROM EMPLOYEE ON ALLEMPLOYEES -
UNION SELECT NAME SALARY FROM EXEMPLOYEE

This creates a new table with two columns and a row per employee.
As many SELECT clauses as required may be UNIONed together as long as the rules on number and type of variables are followed.

If sequence of the output table is important, use the ORDER BY clause to specify it. Any such ORDER BY should follow the last clause of the last SELECT in the command.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top