how to filter an id for subcategory in sql

Posted by Naim Nsco on Stack Overflow See other posts from Stack Overflow or by Naim Nsco
Published on 2012-06-18T03:11:56Z Indexed on 2012/06/18 3:16 UTC
Read the original article Hit count: 152

Filed under:
|

i have create one table with A is 1,2,3 and B is 3,5,5,9,10,10

For example, i want to change from this table

   NP          A          B C

     1          1          3 why not
     1          1          5 weigh
     1          1          5 hello
     1          1          9 no way
     1          1         10 now or never
     1          1         10 float the boat, capt
                             ain

     1          1         12 no nelp
     2          2          4 why
     2          2          6 way too much
     2          2         11 help
     3          3          1 not now
     3          3          2 not
     3          3          7 milky way
     3          3          7 this is stupid
     3          3          8 one way

To be like this:-

   A          B C
    ---------- -- -------- 
     1          3 why not
                5 weigh
                5 hello
                9 no way
               10 now or never
               10 float the boat, capt
                  ain
               12 no nelp

     2          4 why
                6 way too much
               11 help

     3          1 not now
                2 not
                7 milky way
                7 this is stupid
                8 one way

How to do like that?. Anyone know about this?.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about sql