aftab_jii Posted May 11, 2007 Share Posted May 11, 2007 okey.. i have a really complex query.. the reason im asking this is to save my time.. i have two mysql databases..herezz the structure.. Database A (old): It has about 150 users with permissions to about 5 to 10 application Every application can be given and denied permission to a function within the application by setting 0 and 1..the data for the users looks something like this: Username Application Name Function1 Function2 Function3 Function4 Function5 Function6 -------------------------------------------------------------------------------------------- XYZ Sales 1 0 0 1 1 1 ABC Sales 1 1 1 0 0 0 Database B (new): In this database the users are assigned groups and the rest of the table is the same: Username Group Application Name Function1 Function2 Function3 Function4 Function5 Function6 --------------------------------------------------------------------------------------------------- XYZ Logistics Sales 1 0 0 1 1 1 ABC Logistics Sales 1 1 1 0 0 0 Now what i want to do is to copy the data for each function from Database A into Database B so that the permissions in the Database B would be same as Database A...since the only differnce is that in Database B the users are assigned groups.. can anyone help me please Quote Link to comment https://forums.phpfreaks.com/topic/50990-a-really-skewed-up-sql-statement/ Share on other sites More sharing options...
bubblegum.anarchy Posted May 12, 2007 Share Posted May 12, 2007 How are you going to know what groups to add to each row? INSERT...SELECT Quote Link to comment https://forums.phpfreaks.com/topic/50990-a-really-skewed-up-sql-statement/#findComment-251013 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.