tags:

views:

59

answers:

3

I have this table:

culture   street
------------------------
es        Calle Roma 15
eu        Via Roma 15
es        Calle Paris 20
eu        Via Paris 20

Is possible to create an SQL query that retrieve first the rows that the value "es" (in the field culture of course) and the rows that the value "es"?

+2  A: 

There are many different ways to achieve this. One of it is to use UNION:

select * from tbl where culture = 'es'
UNION
select * from tbl where culture = 'eu'
Lee Sy En
+3  A: 

If your table only contains es and eu cultures you can just do an order by

select * from tbl
order by culture
Catfish
+2  A: 
select * from tbl where culture = 'es' or culture = 'eu'
order by culture

should also do the trick :)

Tim Mahy