SQL在hive中执行是正确的,但是使用hive-jdbc ResultSet rs = st.executeQuery(sql) 执行,却在别名处报语法错误
SQL:
SELECT
aa.customerid
FROM
(
(SELECT
customerid
FROM
oder
WHERE saleno = 101870
AND orderstatus NOT IN (1000, 1007, 1008)
AND obcustomertype != 1004
AND source = 1001
AND zipcode != 'null') as aa
LEFT JOIN
(SELECT
customerid
FROM
oder
WHERE saleno IN (
101345,
101955,
101000,
101099,
101362
)
AND orderstatus NOT IN (1000, 1007, 1008)
AND obcustomertype != 1004
AND source = 1001
AND zipcode != 'null') as bb
ON aa.customerid = bb.customerid
)
WHERE bb.customerid IS NULL