Contoh kode yang Anda tunjukkan memiliki elips dan saya yakin apa yang ada di elips itulah yang menyebabkan masalah.
Anda memiliki:
SELECT R.[ID], C.[name] AS [company], ...
FROM [requests] AS R, ...
LEFT OUTER JOIN [companies] AS C
ON R.[company_id] = S.ID
Katakanlah itu seperti:
SELECT R.[ID], C.[name] AS [company], X.Field
FROM [requests] AS R, [eXample] as X
LEFT OUTER JOIN [companies] AS C
ON R.[company_id] = S.ID
WHERE X.[request_id] = R.ID
Dengan kata lain pencampuran sintaks gabungan dalam pra-ANSI 92 dengan sintaks gabungan luar ANSI 92. Pengujian pada SQL Server 2005, tampaknya alias R untuk permintaan tidak terlihat melewati koma yang memisahkan R dari ... dalam contoh Anda, dan [eXample] sebagai X dalam milik saya. Namun berikut ini berhasil:
SELECT R.[ID], C.[name] AS [company], X.Field
FROM [eXample] as X, [requests] AS R
-- Requests and companies on the same side of the comma
LEFT OUTER JOIN [companies] AS C
ON R.[company_id] = S.ID
WHERE X.[request_id] = R.ID
atau
SELECT R.[ID], C.[name] AS [company], X.Field
FROM [requests] AS R LEFT OUTER JOIN [companies] AS C
ON R.[company_id] = S.ID, [eXample] as X
WHERE X.[request_id] = R.ID
-- Yuck, I would hate to find this. Not at all sure from reading
-- the code how it would work.
atau favorit saya, karena saya suka ANSI 92 bergabung dengan sintaks:
SELECT R.[ID], C.[name] AS [company], X.Field
FROM [requests] AS R
INNER JOIN [eXample] as X ON X.[request_id] = R.ID
LEFT OUTER JOIN [companies] AS C ON R.[company_id] = S.ID