[Mysql] Simpel show column name just once?

Discussion in 'MySQL' started by 123GoToAndPlay, Feb 16, 2008.

  1. #1
    Hi all,

    I have a table like
    id | name | descr | sort

    Now sort is the column name that needs to display only once. I am using php


    
    SELECT name, descr, sort,  sort as title FROM tbl ORDER BY sort;
    
    Code (markup):
    i want title just once for every sort
    regards
     
    123GoToAndPlay, Feb 16, 2008 IP
  2. marksailes

    marksailes Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try using distinct()
     
    marksailes, Feb 17, 2008 IP
  3. LinketySplit

    LinketySplit Peon

    Messages:
    97
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I think its a little ambiguous exactly what you're asking.
     
    LinketySplit, Feb 17, 2008 IP
  4. Petey

    Petey Peon

    Messages:
    68
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hi 123GoToAndPlay

    Simply rewrite

    SELECT name, descr, sort, sort as title FROM tbl ORDER BY sort;

    to

    SELECT name, descr, sort as title FROM tbl ORDER BY title;
     
    Petey, Feb 19, 2008 IP