SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru arunkumar's Avatar
    Join Date
    Jan 2005
    Location
    India:Chennai
    Posts
    827
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Mysql a query doubt

    Sir,

    I have a query given below

    /********************************/
    select o.customer_fname,i.itemname from oorder as o left outer join oordertrans as ot on ot.orderid=o.order_id left outer join item as i on i.item_id=o.itemid or i.item_id=ot.itemid,ori_user as us
    where us.userid =o.customer_id and o.date_delivery >= curdate() and o.order_id=5
    /**********************************/
    from the above query the orderid 5 has a 4 items i get a answer like

    customer_fname item name
    rajesh rose
    rajesh lotus
    rajesh jasmine
    rajesh sunflower

    but i want to get the result like

    rajesh rose
    lotus
    jasmine
    sunflower

    is it possible to get it like this.

    If so please give me the query.
    ArunKumar
    Where there is a will there is a way
    ArunKumar

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,263
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    it may be possible, if you can use a "line feed / carriage return" character as the separator in the GROUP_CONCAT function

    otherwise, i would advise you to do this in your application front end

    cosmetically re-arranging data is not a job for sql, it is a job for the user interface
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •