SQL help needed Thread poster: Wolfgang Jörissen
|
Hi all! I messed up a TM by importing memory exports from other people that I actually wanted to keep in a separate TM. I am not too good at SQL (yet), so could one of you give me an SQL command that erases all entries of other users and only keeps the entries that I made myself? TIA Wolfgang | | |
Selcuk Akyuz Türkiye Local time: 16:17 English to Turkish + ... You can try this one | Apr 29, 2008 |
Hi Wolfgang, I do not know too much about SQL commands but this one may help. Do not forget to backup your TM before executing this command! DELETE FROM Sentences WHERE ID IN (SELECT ID FROM Translations WHERE UserNick<>'Wolfgang') HTH Selcuk
[Edited at 2008-08-28 21:01] | | |
Just to make sure... | Apr 29, 2008 |
Thanks Selcuk, backup is already done. I am a bit hesitant though. Isn't this exactly the opposite and wouldn't this pull out all of my entries, leaving the unwanted ones behind? Sorry for my incompetence, please do correct me if I'm wrong. Thanks a lot! Wolfgang | | |
Selcuk Akyuz Türkiye Local time: 16:17 English to Turkish + ...
Wolfgang Jörissen wrote: I am a bit hesitant though. Isn't this exactly the opposite and wouldn't this pull out all of my entries, leaving the unwanted ones behind? Please see my updated message above. | |
|
|
Got the message :-) | Apr 29, 2008 |
Thanks again! | | |
$publisher = "your name"; while ($row = mysql_fetch_array($result)) { $first= $row["id"]; $second = $row["publisher"]; $third = $row["text"]; if ( $second != $publisher) { $other_publishers[] = $second ; } } foreach ($other_publishers as $others_to_delete) { $query = "DELETE FROM tablename WHERE... See more $publisher = "your name"; while ($row = mysql_fetch_array($result)) { $first= $row["id"]; $second = $row["publisher"]; $third = $row["text"]; if ( $second != $publisher) { $other_publishers[] = $second ; } } foreach ($other_publishers as $others_to_delete) { $query = "DELETE FROM tablename WHERE publisher='$others_to_delete' "; $result = mysql_query($query, $db_connection) or die('Error, query failed. ' . mysql_error()); } "publisher" is a name of the column. It indicates who inserted the data. In you case it can be the other name of the column that indicates the names of publishers Nerijus
[Edited at 2008-04-29 11:36] ▲ Collapse | | |
You have to use entities to display those characters | May 18, 2008 |
Selcuk Akyuz wrote: Unfortunately the command is not displayed correctly, I think it is because of the html codes used in ProZ.com forums. You can see it if you quote my message. To display the greater than and lesser than symbols here, you'll have to use an ampersand character followed by lt or gt and then terminated by a semicolon. The results look like this: < >
[Edited at 2008-05-18 18:27] | | |
yanadeni (X) Canada Local time: 09:17 French to Russian + ...
0. Open the TM 1. Show the desired language on the left 2. Click SQL... 3. Enter the command For example UserNick="barak.obama" or datestamp >= #14/10/2007# the first command shows all the entries of Barak Obama the second - all the entries after October 14 2007 4. Click Apply 4.1. After all the desired entries are shown, select them all and click Remove. 5. To ... See more 0. Open the TM 1. Show the desired language on the left 2. Click SQL... 3. Enter the command For example UserNick="barak.obama" or datestamp >= #14/10/2007# the first command shows all the entries of Barak Obama the second - all the entries after October 14 2007 4. Click Apply 4.1. After all the desired entries are shown, select them all and click Remove. 5. To show all the entries click All rows. ▲ Collapse | | |
To report site rules violations or get help, contact a site moderator:
You can also contact site staff by
submitting a support request »