2016-07-25 33 views
-1

以下是mysql查詢,我希望重複結果中的數據。我試過UNION ALL,但它會引發語法錯誤。重複在MYSQL

Select attribute_name from attribute WHERE (SELECT attribute_id from platform_metadata_map); 

任何幫助表示讚賞!

+1

顯示樣品數據和所需結果。那個where子句是沒有意義的,所以沒有提供你實際嘗試實現的內容。同時顯示您嘗試使用「union all」以及您嘗試過的其他任何不起作用的內容。人們需要知道你想要做什麼以及什麼是失敗的,以便他們能夠根據需要進行糾正。 –

+0

我認爲你需要向我們展示能夠提供幫助的表格 – HenryM

回答

0

這是錯誤怎麼一回事,因爲

Select attribute_name 
from attribute 
WHERE (SELECT attribute_id from platform_metadata_map); 

where子句不匹配(你shoudl使用其中attribute_id =(選擇....)) 反正你要重複,你應該使用UNION ALL repet TEH查詢

Select attribute_name 
from attribute 
union all 
Select attribute_name 
from attribute 
union all 
Select attribute_name 
from attribute 
union all 
Select attribute_name 
from attribute