There is nothing wrong with the syntax per se
That JOIN is awful though ... consider setting up a proper primary key / foreign key relationship
By "it's not working" I take it to mean that it is not returning any results, but that it does return results if you remove
and b.vcode=001
Firstly - why the preceding zeroes ... if columns
vcode
and
distt
are numeric then write this as
where a.distt=17 and a.block=1 and b.vcode=1
However if they are char or varchar then write it like this
where a.distt=17 and a.block='01' and b.vcode='001'
After that, if you are still not getting results back then there is no matching data on your table. Run it without that last condition but adding vcode to the SELECT - have a good look at the results, you'll find that none of the records have vcode = 1