Say I have two tables like below..
status
HId sName dName StartTime EndTime
1 E E 9:10 10:10
2 E F 9:15 10:15
3 G H 9:17 10:00
logic
Id devName capacity free Line
1 E 123 34 1
2 E 345 45 1
3 G 345 23 0
status.HId and logical.Id denote the same value that is a id of a server
I'm trying to write a query to retrieve for a few columns in each table where logic.Line=1;
select HId, sName, dName, StartTime, capacity, free from status s, logical l WHERE s.HId=2 and l.Line=1;
expecting the output to be.. but the above query gives multiple lines of output..
HId sName dName StartTime capacity free
2 E F 9:15 345 45
i'm not sure if we can achieve with mysql joins here but want to take advice while i can read and do the above..