Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post 
Post Need Help With SQL Query 
 
Hey guys,

i hope someone can help me with the following, and can provide a sql query for it... my mysql knowlegde is to low to do it on my own...

I need to delete all entries in TABLE_1 where topic_xxx from TABLE_2 is set to "0"... in both tables i have the topic_id field...

something like this, but this did not work:

Code: [Download] [Hide] [Select]
DELETE FROM `phpbb_table_1` WHERE `phpbb_table_2`.`topic_xxx` =0;


can someone help me with this?...

Thanks
 




____________

Play Games at GamesCampus!
 
KugeLSichASend private messageVisit poster's website  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: Need Help With SQL Query 
 
A bit difficult without seeing the actual script you want to change, but maybe this will help with what you are trying to drop.

ALTER TABLE  phpbb_table_1 DROP  topic_xxx;

That should drop the query sub-table, and don't forget to optimise the Db after you've applied it.
 
 
 
Back to topPage bottom
Reply with quote Download Post 
Post Re: Need Help With SQL Query 
 
Code: [Download] [Hide] [Select]
DELETE FROM `phpbb_table_1` WHERE `phpbb_table_1`.`topic_xxx` = `phpbb_table_2`.`topic_xxx`;

 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Need Help With SQL Query 
 
hey guys,

many thanks for your help... but it didnt work...

so i have checked and study the mysql dev again, played a bit and now it works with the following (just for the people how are interested in)

Code: [Download] [Hide] [Select]
DELETE FROM phpbb_table_1
USING phpbb_table_1, phpbb_table_2
WHERE phpbb_table_2.topic_xxx = 0 AND phpbb_table_2.topic_id = phpbb_table_1.topic_id

 




____________

Play Games at GamesCampus!
 
KugeLSichASend private messageVisit poster's website  
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events