Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2005
    Posts
    266

    Unanswered: problem in copying a table into another one

    I am having problems to copy a table into another one

    SELECT * INTO UserCopy FROM User WHERE User.ID IN (SELECT MAX(ID) AS LastId FROM Category GROUP BY CatUser)

    with SELECT MAX(ID) AS LastId FROM Category GROUP BY CatUser I get : 1,2,3,10

    now if I look the result in my table Usercopy I get the values for : 1,2,3,9,10

    what can be the problem ? where does the 9 comes from

    thank you

  2. #2
    Join Date
    Jan 2005
    Location
    Green Bay
    Posts
    201
    was the table empty when you started

  3. #3
    Join Date
    Dec 2005
    Posts
    266
    userCopy of course is empty because it is just created

    user is full and category too
    I want to extract datas from user depending on an ID list in category

    thank you for helping

  4. #4
    Join Date
    Jan 2005
    Location
    Green Bay
    Posts
    201
    I created table to test data and as I first though first
    your logic is correct

    If you return 1,2,3,10
    that is what should be used to create your table.

    Try to hardcode 1,2,3,10 and see what that returns.
    or
    just run the select instead of the into and what is returned.

    Could you be looking at usercopy created by another owner.
    Could you be selecting from a user a category table from another owner.

  5. #5
    Join Date
    Dec 2005
    Posts
    266
    ok I try ! and i come back :-)

    thank you

  6. #6
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    read the sticky at the top of the forum and posts what it asks you to give....
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

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