|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
query help needed
I have these tables:
level_logg Level_Logg_Timestamp Tank_ID<FK> tank Tank_ID Pejl_ID<FK> pejl Pejl_ID Pejl_Placement_ID<FK> Customer_Number<FK> pejl_placement Pejl_Placement_ID Placement_Name customer Customer_Number Customer_Name I'm trying to make a query the that I get the folowing result: Pejl_ID Customer_Name Placement_Name Level_Logg_Timestamp I need some help to get this right, I have no problem gettting everything except the timestamp there I don't know how to do. plz help .patrik |
|
#2
|
|||
|
|||
|
You could post what you have so far... but basically from what I've read I would use something like this:
SELECT pejl.pejl_id, customer.customer_Name, pejl_placement.placement_Name, level_logg.level_logg_timestamp FROM level_logg INNER JOIN tank ON level_logg.tank_id = tank.tank_id INNER JOIN pejl ON tank.pejl_id = pejl.pejl_id INNER JOIN pejl_placement ON pejl.pejl_placement_id = pejl_placement.pejl_placement_id INNER JOIN customer ON pejl.customer_number = customer.customer_number It seems from what you wrote that this are all 1 to 1 relationships, I think. Try that. |
|
#3
|
|||
|
|||
|
thx worked lika a charm! had been thinking a little wrong...
.p |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > query help needed |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|