看一下,谢谢
我表关联后,为什么报错说有一个字段找不到
在数据库客户端中运行这一段sql后是正常的,就是在java程序中报错,说找不到某一个字段
请高手指点,谢谢
[解决办法]
SELECT `user`.storeName AS storeName,
`user`.ID AS sellerId,
t7.andriodCount AS andriodCount,
t7.updateTime AS updateTime,
t7.appleCount AS appleCount,
t7.appGenTime
FROM (select *
FROM (
select *
FROM (
select *
FROM (
SELECT process_status AS appleCount,
seller_id AS appleSellerId
from seller_apply_request AS re
where request_type='0'
and update_time=(
select MAX(update_time)
from seller_apply_request
where seller_id=re.seller_id
and request_type=re.request_type
GROUP BY seller_id)) AS t1
LEFT JOIN (SELECT process_status AS andriodCount,
seller_id AS androidSellerId
from seller_apply_request AS re
where request_type='1'
and update_time=(
select MAX(update_time)
from seller_apply_request
where seller_id= re.seller_id
and request_type=re.request_type
GROUP BY seller_id)) AS t2
on t1.appleSellerId=t2.androidSellerId) AS t3
LEFT JOIN (
select MAX(update_time) AS updateTime ,
seller_id AS infoSellerId
from seller_app_info
GROUP BY seller_id) AS t4
on t4.infoSellerId=t3.appleSellerId) AS t5
LEFT JOIN (
SELECT MAX(gen_time) AS appGenTime,
seller_id AS genSellerId
from app_gen_info GROUP BY seller_id) AS t6
on t6.genSellerId=t5.appleSellerId) AS t7
LEFT JOIN `user`
on t7.appleSellerId=`user`.ID
ORDER BY updateTime desc