|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
||||
|
||||
|
Hi all,
I need to build an SQL query invloving 3 tables and I'm a bit stuck (it's that time of day). I have the following three tables: Mat2Prod, with columns "Code" and "Product" Mat2Age, with colums "Code" and "Age" Mat, with "Code" (and others) I need to find all rows in Mat where Product = $var1 and Age = $var2, with both of the $vars given. I've done joins before with 2 tables but with three my head starts hurting. Any help appreciated!
__________________
Yours, Frank Reding, IconoclastDesign.co.uk. |
|
#2
|
||||
|
||||
|
SELECT a.*, b.*, c.*
FROM Mat2Prod a, Mat2Age b, Mat c WHERE a.Code = b.Code AND a.Code = c.Code AND a.Product = $var1 AND b.Age = $var2 |
|
#3
|
||||
|
||||
|
Query
Many thanks!
|
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > Help in building advanced query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|