kamkam
08-18-2009, 10:34 AM
Hi;
I have a table for rentting house
create table rent(id smallint auto_increment,
area varchar(200),
content text,
price varchar(200);
submittime TIMESTAMP Default CURRENT_TIMESTAMP,
primary key(id)
)
How i can display the result order by area as ASC, and if the areas are same,
they will order by price as ASC ?
for example
1)
area: abe
price $9
content: xxxxxx
2)
area: abe
price $19
content: xxxxxx
3)
area: abe
price $29
content: xxxxxx
4)
area: dbe
price $29
content: xxxxxx
5)
area: dbe
price $39
content: xxxxxx
6)
area: kbe
price $39
content: xxxxxx
i just can do the following, could anyone help me, please.
select * from rent order by area asc
I have a table for rentting house
create table rent(id smallint auto_increment,
area varchar(200),
content text,
price varchar(200);
submittime TIMESTAMP Default CURRENT_TIMESTAMP,
primary key(id)
)
How i can display the result order by area as ASC, and if the areas are same,
they will order by price as ASC ?
for example
1)
area: abe
price $9
content: xxxxxx
2)
area: abe
price $19
content: xxxxxx
3)
area: abe
price $29
content: xxxxxx
4)
area: dbe
price $29
content: xxxxxx
5)
area: dbe
price $39
content: xxxxxx
6)
area: kbe
price $39
content: xxxxxx
i just can do the following, could anyone help me, please.
select * from rent order by area asc