Select into ChatZilla

on Thursday, July 9, 2009
Doing lots of SQL stuff these days. Playing with tables and chairs[:)]. If you have seen my twitter posts, you might have found my twit about a problem that i came across in SQL. I was finding a way to create a local copy of table which can be updated without touching the original table. Now here local copy doesnt mean the copy on client side! otherwise i might have used SESSIONS. But say i want to have the same copy distributed over to a group of users! ugh...
Now there was(i first thought) one solution,that is to create a view, but i read somewhere(not sure?) that when we update(not alter) the view, i.e when we update the data in the view, the original table is also updated. I haven't found any good document about this. And havent bothered to try it myself.
Then i thought why not ask to people who better know these things... and where these geeks can be found (forums, nowadays are full of marketting), so the only other place is IRC, so installed chatZilla for the first time and tried to chat through IRC and there i got the real answer!..
We need to COPY the table into a new one every time we need it, and then just drop it when the work is over! done!... But its not as easy(!its time consuming). so i got a command "SELECT INTO". which can copy my table into a new one (even in other database). But it was not working, i was like...Eh... WHY?? then i found that mysql doesn't support it and so i got another one "INSERT INTO ... SELECT ..." (a more simple one than i thought!).. It worked!...
So the moral of the story is whenever you got problem go "SELECT INTO CHATZILLA".

0 comments:

Post a Comment