Grep on a MySQL / Linux federated table

I can't get grep -v "Africa" ​​on this table without errors, can anyone help me with the syntax in Ubuntu?

There is a mistake somewhere, and one of my countries does not have a macro-region (for example, America, Africa, Asia, Europe), and I cannot find it. I need to collect this combined table to see which country has only subregions.

select country, group_concat(region) as regions from regions group by country;

(footer looks like this)

| 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  

I use:

mysql -u root -pPASS "use reports" | mysql -u root -pPASS -e "select a country, group_concat (region) as regions from regions by countries;" | grep -v 'Africa'

And I get the error message:

ERROR 1049 (42000): Unknown Use Reports database ERROR 1046 (3D000) in row 1: no database selected

+3
1
mysql -u root -pPASS reports -e "select country, group_concat(region) as regions from regions group by country;" | grep -v 'Africa'

: . - ; SQL-.

-, mysql , , ; . , . , , :

mysql -u root -pPASS -e "use reports; select country, group_concat(region) as regions from regions group by country;" | grep -v 'Africa'
+3

All Articles