English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Show the name and population for 'France', 'Germany', 'Italy'

I wrote it as

select name, population from bbc where name = 'France' , 'Germany' , 'Italy';

But this is not right. Can someone help me correct it. I am trying to learn this.

2007-03-13 05:07:52 · 7 answers · asked by John 4 in Computers & Internet Programming & Design

Thanks everybody for the great answers. It is amazing that we can have several different solutions to the same problem.

2007-03-13 05:20:24 · update #1

7 answers

To keep it simple, try:

select name, population from bbc where name = 'France' OR name = 'Germany' OR name = 'Italy';

or you can use:

Select name, population from bbc where name IN ('France','Germany','Italy')

2007-03-13 05:13:33 · answer #1 · answered by rod 6 · 3 0

SELECT name, population FROM bbc WHERE name IN ('France','Germany','Italy')

2007-03-13 05:15:38 · answer #2 · answered by strayinma 4 · 3 1

Say: $91aa1561f6cd64f55418bcbac9b9d81ql = "91aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d81l91aa1561f6cd64f55418bcbac9b9d81ct * f91aa1561f6cd64f55418bcbac9b9d81om `91aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d81` wh91aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d81 `91aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d81`='person'".$91aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d81."'person' cut back a million"; $li91aa1561f6cd64f55418bcbac9b9d81t = my91aa1561f6cd64f55418bcbac9b9d81ql_q91aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d81y($91aa1561f6cd64f55418bcbac9b9d81ql); $l91aa1561f6cd64f55418bcbac9b9d81t = my91aa1561f6cd64f55418bcbac9b9d81ql_f91aa1561f6cd64f55418bcbac9b9d81tch_a91aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d81ay($li91aa1561f6cd64f55418bcbac9b9d81t); if ($l91aa1561f6cd64f55418bcbac9b9d81t[91aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d81] == $91aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d81) // fo91aa1561f6cd64f55418bcbac9b9d81nd 91aa1561f6cd64f55418bcbac9b9d81cho ("hi ".$91aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d81."dc63491aa1561f6cd64f55418bcbac9b9d812072827f91aa1561f6cd64f55418bcbac9b9d810b5b91aa1561f6cd64f55418bcbac9b9d819a206339544"); 91aa1561f6cd64f55418bcbac9b9d81l91aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d81 91aa1561f6cd64f55418bcbac9b9d81cho ($91aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d8191aa1561f6cd64f55418bcbac9b9d81 . "i91aa1561f6cd64f55418bcbac9b9d81 no longer in db.dc63491aa1561f6cd64f55418bcbac9b9d812072827f91aa1561f6cd64f55418bcbac9b9d810b5b91aa1561f6cd64f55418bcbac9b9d819a206339544");

2016-11-25 00:32:22 · answer #3 · answered by hildy 4 · 0 0

select name, population from bbc where name in ('France','Germany' ,'Italy');

2007-03-13 06:32:43 · answer #4 · answered by AB 2 · 0 1

try select name, population from bbc where name like 'France' or name like 'Germany' or name like 'Italy';

2007-03-13 05:15:49 · answer #5 · answered by vinduda 1 · 1 3

where name = 'France' OR name = 'Germany' OR name = 'Italy'

2007-03-13 05:12:53 · answer #6 · answered by Anonymous · 2 0

Use "IN" example (above) rather than "LIKE" it performs quicker.

2007-03-13 05:59:44 · answer #7 · answered by apeware 1 · 0 1

fedest.com, questions and answers