Monday, March 26, 2012

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 youwas the table empty when you started|||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|||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.|||ok I try ! and i come back :-)

thank you|||read the sticky at the top of the forum and posts what it asks you to give...

No comments:

Post a Comment