I have three database tables:
system_profile
id manufacturer model name total_physical_memory
12345 my_pc 5000 DGS 3219206144
device
id version date_created device_id instance
2828493 0 2013-10-13 20:13:00 12345 q
2828494 1 2013-10-13 xxxxx 12345 e
2828495 2 2013-10-13 aaaaa 12345 r
2828496 3 2013-10-13 ccccc 12345 r
hw_profile
id manufacturer model name disk device_id
12345 my_pc 5000 ABC 2 gb 12345
The hw_profile and system_profile tables are linked by primary key "id"
The hw_profile and device tables are linked by a device_id.
I am trying select to "get just the system_profile.total_physical_memory":
SELECT system_profile.total_physical_memory
FROM system_profile, hw_profile, device
WHERE hw_profile.id = system_profile.id
AND device.device_id = hw_profile.device_id
This query is not working (I am getting multiple results) back.
I need to return "just" system_profile.total_physical_memory (3219206144)
I have tried various left joins, exists - but no success.
A clear example would be great (plus some aspirin).
Thanks
Miles.