SELECT b.*,
a.jeopCodeId,
a.JeopCodeDetail
FROM storm_jeopinfo a,
storm_orders b
WHERE a.ordernumber IS NOT NULL
AND a.ordernumber = b.order_number
AND b.Installed_dt IS NOT NULL
AND b.CUST_SIGN_DT BETWEEN CONVERT(date, '2012-06-01', 102)
AND CONVERT(date, '2013-04-30', 102)
UNION ALL
SELECT b.*,
a.jeop_code,
a.jeop_desc
FROM storm_bpm_jeops a,
storm_orders b
WHERE b.order_number = a.Order_number
AND b.srvc_order_unit = a.srvc_order_unit
錯誤消息:將所述VARCHAR值 'JEOP-008' 爲數據類型int時轉換失敗。誤差變換爲varchar到int
它繼續與下一列的系列。我無法成功執行此查詢。根據您的更新
在第一個選擇中你選擇了'a.jeopCodeId'和第二個'a.jeop_code'。它們是相同的數據類型嗎? – jalynn2 2013-05-07 18:57:55
使用隱式連接是一種非常糟糕的編程技巧。請閱讀http://www.amazon.com/SQL-Antipatterns-Programming-Pragmatic-Programmers/dp/1934356557/ref=sr_1_1?s=books&ie=UTF8&qid=1367959865&sr=1-1&keywords=sql+antipatterns找出這個問題和其他SQL反模式。 – HLGEM 2013-05-07 20:51:29