SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict ketting00's Avatar
    Join Date
    Jul 2011
    Posts
    309
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    How to divide a column into multiple rows

    Hi,
    I've a simple question I can't solve myself.
    I have this column:
    Code:
    id        item
    1          A
    2          B
    3          C
    .          .
    .          .
    .          .
    298      Z
    I want to turn it into this:
    Code:
    id
    1          101         201
    2          102         .
    3          103         .
    .           .            297
    .           .            298
    .           .
    100       200
    How do I achieve this along with the other columns associated to it?

    Thank you.

    Sorry for the headline, just notice it.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,015
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by ketting00 View Post
    How do I achieve this along with the other columns associated to it?
    with your application language (php or whatever)

    don't even try to do this type of layout with sql
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Addict ketting00's Avatar
    Join Date
    Jul 2011
    Posts
    309
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    I use PHP. I notice that facebook can do this.

    Thanks,

    EDIT: I found this: http://stackoverflow.com/questions/3...on-list-length

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,015
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by ketting00 View Post
    I notice that facebook can do this.
    and lawrence livermore labs can do nuclear weapons, but that doesn't mean i want to write the sql for it
    r937.com | rudy.ca | 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
  •