Results 1 to 3 of 3

Thread: Insert Statement ?

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 1999
    Posts
    44

    Post

    I got a problem with a insert statement. I have two table such as :
    in first table (Mscat) i have a data :
    User CategID CategName
    B 1 Budy
    B 2 Rudy
    C 3 Heny

    In second table (TmpMscat) i have a data :
    User CategID CategName
    D 5 Wani
    D 6 Runi
    E 7 Yuki
    E 8 Lucky

    Then I use statement : insert into TmpMscat select * from Mscat where user = B

    When I run and result is like that
    D 5 Wani
    D 6 Runi
    B 1 Budy
    E 7 Yuki
    E 8 Lucky
    B 2 Rudy

    But I want data to be insert into table at last record or like that :
    D 5 Wani
    D 6 Runi
    E 7 Yuki
    E 8 Lucky
    B 1 Budy
    B 2 Rudy

    So Anyone can help me ?


    Best Regard's

    Long



  2. #2
    Lively Member
    Join Date
    May 1999
    Location
    Atlanta, GA
    Posts
    75

    Post

    You need to use an "order by" statment

    When inserting, try:
    insert into TmpMscat select * from Mscat where user = B order by user

    When pulling from the table, try:
    select * from TmpMscat order by user

    Jay

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 1999
    Posts
    44

    Post

    I means not sort by.

    In second table already have a data so when i insert, i want it's insert into last record


    Long

Posting Permissions

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



Click Here to Expand Forum to Full Width