mysql query for multiple columns from multiple tables in a DB

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..

It just smushes them together indiscriminately because, when two tables have nothing to do with each other, it's got no way to know which rows are relevant and which aren't. The rows aren't strictly guaranteed to be in any particular order; to be consistent it has to consider all possibilities.

Or do the tables have anything in common you'd like to match on?

yes the tables have HId and Id in common.

sql easily supports that, but you need to tell it what things to join on.

SELECT ... FROM s LEFT JOIN local ON (s.hid = local.id) WHERE ...

You may need to tell it local.columname instead of just columnname for columns in local.