Try GROUP BY in the select statement:

         select services, machine_name from table
                 GROUP BY services
                 order by machine_name;

I believe it should return:

MS Exchange Server and BDC
         MAIL
Microsoft Exchange for UA
         UAMAIL1
         UAMAIL2
         UAMAIL3

How well MySQL supports GROUP BY I don't know; I would try this at the 
console first. The returned result set may make for some tricky processing, 
or it could be as easy as printing out every row.

Alternately, it's a display question. If results are displayed in tabular 
format, write the description once, and if it repeats, don't display it in 
remaining rows until it changes.

Or have I completely misunderstood the question?

Miles Thompson

At 11:30 AM 8/1/01 -0500, Sharif Islam wrote:

>I have some data in a table like this:
>
>+----------------------------+--------------+
>| services                   | machine_name |
>+----------------------------+--------------+
>| MS Exchange Server and BDC | MAIL         |
>| Microsoft Exchange for UA  | UAMAIL1      |
>| Microsoft Exchange for UA  | UAMAIL2      |
>| Microsoft Exchange for UA  | UAMAIL3      |
>+----------------------------+--------------+
>
>As you can see, there are same entry for the services column. So If
>I to display in php :
>
>select services from table; then I will get three same entry.
>
>
>Is there any way, I can get only one output.But somehow I have to
>incorpate it with the other data in that column, which doesn't have
>multiple entry. Any hint? thanks in advance.
>
>
>
>
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to