StumbleUpon  Del.icio.us  Facebook  Reddit  Add to diigo  


Follow - Monx007
Article Time Stamp: 21 September 2008, 14:35:44 GMT+7

Microsoft SQL (MS SQL): Sample SQL Script to Select All Fields From One Tabel Within Multiple Tables Query



In this example, we want to select all fields from tbl_detail and field name from tbl_owner in a multiple tables query. This query wants to retrieve all the available Chevrolet Spark vehicles that manufactered at 2003.


SELECT tbl_a.*, tbl_b.name

FROM
tbl_detail AS tbl_a,
tbl_owner AS tbl_b,
tbl_vehicles AS tbl_c,
tbl_manufactured AS tbl_d

WHERE
tbl_a.id = tbl_b.id AND
tbl_a.id = tbl_c.id AND
tbl_a.id = tbl_d.id

AND
tbl_c.type = 'Chevrolet Spark'

AND
tbl_d.year_prod = '2003'



Article Source: Monx Digital Library

Copyrighted@ Monx Digital Library, otherwise stated
Use of our service is protected by our Terms of Use



 Back To Previous Page ...  



 

 

 

AQWorlds Nulgath Secret Walkthrough