clear markdown compare help best fiddles feedback dbanow.uk
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2591492 fiddles created (45733 in the last week).

CREATE TABLE the_table( id integer not null ,date_ date ,persons integer ,two_wheelers integer ,cars integer ,vans integer ,buses integer , autos integer );
 hidden batch(es)


INSERT INTO the_table(id, date_, persons, two_wheelers, cars, vans, buses, autos) VALUES (1, '21/JAN/2018',1,1,1,1,1,1)
 hidden batch(es)


INSERT INTO the_table(id, date_, persons, two_wheelers, cars, vans, buses, autos) VALUES (2, '21/JAN/2018',2,2,2,2,NULL,2)
 hidden batch(es)


INSERT INTO the_table(id, date_, persons, two_wheelers, cars, vans, buses, autos) VALUES (3, '21/JAN/2018',3,3,3,3,NULL,NULL)
 hidden batch(es)


SELECT * FROM the_table;
id date_ persons two_wheelers cars vans buses autos
1 21/JAN/2018 1 1 1 1 1 1
2 21/JAN/2018 2 2 2 2 2
3 21/JAN/2018 3 3 3 3
 hidden batch(es)


DELETE FROM the_table WHERE NOT EXISTS ( SELECT * FROM the_table t1 NATURAL JOIN the_table t2 WHERE id = the_table.id )
 hidden batch(es)


SELECT * FROM the_table;
id date_ persons two_wheelers cars vans buses autos
1 21/JAN/2018 1 1 1 1 1 1
 hidden batch(es)