show required row first and then other remaining rows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

 

Consider the following case

 

mysql> select *from names;

+----+---------+------------+

| id | name    | phone      |

+----+---------+------------+

|  1 | sanju   | 9845650000 |

|  2 | sanjeev | 9972230000 |

|  3 | puttu   | 9900580000 |

|  4 | raju    | 9448110000 |

+----+---------+------------+

 

Now I want to display the row whose name is puttu (id=3) first and then want
to display other rows in order (order by name) as follows

+----+---------+------------+

| id | name    | phone      |

+----+---------+------------+

|  3 | puttu   | 9900580000 |

|  4 | raju    | 9448110000 |

|  2 | sanjeev | 9972230000 |

|  1 | sanju   | 9845650000 |

+----+---------+------------+

 

Can somebody tell me is it possible. If its possible then please help me to
solve this problem.

Actually I am fetching all the rows from this table to my php page and there
if I choose some name then that should appear at top and rest should be
below in name order.

 

Warm Regards,

Sanjeev

http://www.sanchanworld.com/

http://webdirectory.sanchanworld.com - Submit your website URL

http://webhosting.sanchanworld.com - Choose your best web hosting plan


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux