i have the follwoing data
patno hospno Roomcode
1 123
1 124
i have another table
patno hospno proc_code
1 123 256
1 123 258
1 123 300
1 124 500
i have another table chargemaster
proc_code department
258 701
200 701
could you pls tell me how to write a query to accomplish the follwing
i have to get all proc codes for department 701
now, i have to see if the patno and unitnum in the very first table have a proc code that belongs to department 701, if yes, i have to mark that record with 1
in this scenario, since 1 123 has one of the proc codes to be 258 which belongs to deartment 701, it gets marked with 1
please help.
thanks a lot
nik