ufo forum Forum Index
  FAQ   Search   Memberlist   Usergroups    Galleries   Register   Profile   Log in to check your private messages   Log in 
atmosphere jordan 1 How To Join Two Tables In A Re

 
Post new topic   Reply to topic    ufo forum Forum Index -> UFO Forum
View previous topic :: View next topic  
Author Message
yan9m5k6




Joined: 30 Mar 2011
Posts: 93
Read: 0 topics

Warns: 0/5
Location: England

PostPosted: Thu 8:57, 19 May 2011    Post subject: atmosphere jordan 1 How To Join Two Tables In A Re
power of a relational database such as Oracle, SQL Server, MySQL and Access is the aptitude to relate two or more tables based on prevalent fields. Here is how you can combine two tables on a common field. I am using MS Access's Northwind database to jot the SQL expression.
1. Database Database Open your relational database. For my instance I am using Microsoft's Northwind database,[link widoczny dla zalogowanych], which is the database that comes with Microsoft.
2. Tables Tables I am going to use the orders chart and the orders detail table and I ambition narrate the 2 tables based on the Order ID field. Each mandate has a peerless index called the order id. This order id is saved in the order details table since you can have multiple items bought ashore the same order.
3. SQL statement SQL statement I selected a pair of fields from either tables so you can discern how the file is returned. I then join the two tables on the order if field. So my SQL statement looks favor this: "SELECT [Order Details].OrderID,[link widoczny dla zalogowanych], [Order Details].ProductID,[link widoczny dla zalogowanych],[link widoczny dla zalogowanych], Orders.OrderDate, Orders.ShippedDate, [Order Details].UnitPrice FROM Orders,[link widoczny dla zalogowanych],[link widoczny dla zalogowanych], [order details] where Orders.OrderID = [Order Details].OrderID;" Anything you discern encircled with [] means that the field or table appoint is more than one word using a space to separate the words.
4. Final results Final results Now sprint your sql statement. You will see the fields selected exhibited and the two tables joined.


The post has been approved 0 times
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    ufo forum Forum Index -> UFO Forum All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


fora.pl - załóż własne forum dyskusyjne za darmo
Powered by phpBB © 2001, 2002 phpBB Group Boyz theme by Zarron Media 2003



Regulamin