This query is giving me an error...
SELECT
b.c_loc
, r1.c_gsa_resp
, r2.c_gsa_resp
FROM dbo_tbldg b
LEFT JOIN (select c_loc, c_gsa_resp from dbo_tbldgresp where c_gsa_resp = '1') r1 on b.c_loc = r1.c_loc
LEFT JOIN (select c_loc, c_gsa_resp from dbo_tbldgresp where c_gsa_resp = '2') r2 on b.c_loc = r2.c_loc
WHERE b.c_region = '11'
Is the syntax ok? Can I use more than 1 derived table? I want to use a total of 9...
Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)
SELECT
b.c_loc
, r1.c_gsa_resp
, r2.c_gsa_resp
FROM dbo_tbldg b
LEFT JOIN (select c_loc, c_gsa_resp from dbo_tbldgresp where c_gsa_resp = '1') r1 on b.c_loc = r1.c_loc
LEFT JOIN (select c_loc, c_gsa_resp from dbo_tbldgresp where c_gsa_resp = '2') r2 on b.c_loc = r2.c_loc
WHERE b.c_region = '11'
Is the syntax ok? Can I use more than 1 derived table? I want to use a total of 9...
Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)