Reputation: 31709
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"?
Upvotes: 1
Views: 103
Reputation: 1316
I am not sure whether you wanted something like this:
First of all, to retrieve the rows that has the value "es" in culture column, you need to write the following query -
SELECT * FROM SOMETABLE WHERE culture = "es"
Next, I am assuming you wanted to retrieve the rows that has the value "eu", you made a typo here. Same query -
SELECT * FROM SOMETABLE WHERE culture = "eu"
And please mention the table name whenever you are asking questions regarding SQL and SQL Query.
Upvotes: 0
Reputation: 1319
select * from tbl where culture = 'es' or culture = 'eu'
order by culture
should also do the trick :)
Upvotes: 2
Reputation: 19284
If your table only contains es and eu cultures you can just do an order by
select * from tbl
order by culture
Upvotes: 3