Tuesday, July 28, 2009

How do I open tow or more tables from the same DB to appear on my web page using ASP?

I have three tables I would like to show information from? I can show information from 1 table right now...how do I show the other two on the same page?

How do I open tow or more tables from the same DB to appear on my web page using ASP?
In SQL you can join than one table in a query. There are different types of joins








INNER JOIN - excludes rows from either table that don't have a matching row in the other table.





OUTER JOIN - provides the ability to include unmatched rows in the query results





LEFT -- only unmatched rows from the left side table (table-1) are retained


RIGHT -- only unmatched rows from the right side table (table-2) are retained


FULL -- unmatched rows from both tables (table-1 and table-2) are retained





Example:





SELECT product.productNumber, ProductDetails.desc


FROM product


LEFT OUTER JOIN ProductDetails


ON product .productNumber = ProductDetails.productNumber
Reply:I think you only need to do the same as you have done to display data from table 1.. create another query and change the table name to your other tables


No comments:

Post a Comment