left join not working CREATE TABLE `table1` (
`id` INT(10) NOT NULL 
)
ENGINE=InnoDB;

CREATE TABLE `table2` (
`id` INT(10) NOT NULL,
`value` INT(10) NOT NULL
)
ENGINE=InnoDB;

INSERT INTO table1
VALUES (1), (2), (3), (4);

INSERT INTO table2
VALUES (1, 100), (2, 200);


I want to get table like:

id value
1  100
2  200
3  null
4  null


My query is

SELECT t1.id, t2.value
FROM table1 t1
LEFT JOIN table2 t2
    ON t2.id = t1.id


and I got:

1 100
2 200


How should I query the database to get what I want?
hye i tried below query in mysql and SQL server databases its working fine, so please check once again. and tell me which database u tried.

SELECT t1.id, t2.value
FROM table1 t1
LEFT JOIN table2 t2
    ON t2.id = t1.id

id   value  
--  --------
 1       100
 2       200
 3    (NULL)
 4    (NULL)


Thanks.