我似乎无法在这张桌子上得到 grep -v "Africa" 而不会抛出错误,有人可以帮助我在 Ubuntu 中使用语法吗?
某处出现错误,我的一个国家没有定义宏观区域(即美洲、非洲、亚洲、欧洲),我找不到它。我需要对这个连接表进行 grep 以查看哪个国家/地区只有子区域。
select country, group_concat(region) as regions from regions group by country;
(其页脚看起来像这样)
| Ukraine | Eastern Europe,Europe
| United Arab Emirates | Middle East,Persian Gulf,Western Asia
| United Kingdom | Europe
| United States | Americas,North America
| Uruguay | Americas,South America
| Uzbekistan | Asia,Central Asia
| Vanuatu | Australasia,Melanesia,Oceania
| Venezuela | Amazon,Americas,Andes,South America
| Vietnam | Asia,East Asia,Indochina
| Virgin Islands | Americas,Caribbean
| Wallis and Futuna Islands | Australasia,Oceania,Polynesia
| Yemen | Middle East,Persian Gulf,Western Asia
| Zambia | Africa,Central Africa,East Africa,Southern Africa
| Zimbabwe | Africa,Central Africa,East Africa,Southern Africa
我用:
mysql -u root -pPASS "使用报告"| mysql -u root -pPASS -e "select country, group_concat(region) as region from regions group by country;"| grep -v '非洲'
我得到了错误:
错误 1049 (42000):未知数据库“使用报告”第 1 行错误 1046 (3D000):未选择数据库