-- 查詢具體表的分區目錄 select t1.NAME, t2.TBL_NAME,t4.PART_NAME, t3.LOCATION from DBS t1, TBLS t2 , SDS t3 ,PARTITIONSt4 where t1.DB_ID=t2.DB_ID and t4.SD_ID = t3.SD_ID AND t2.TBL_ID = t4.TBL_ID and t1.NAME` = '數據庫名' AND t2.TBL_NAME like '表名' UNION -- 查詢具體表的目錄 select t1.NAME, t2.TBL_NAME,'null', t3.LOCATION from DBS t1, TBLS t2 , SDS t3 where t1.DB_ID=t2.DB_ID and t2.SD_ID = t3.SD_ID AND t1.NAME = '數據庫名' AND t2.TBL_NAME like '表名' ;`