suppose we will delete the records from recycle bin means where those records being(i mean which place those items saved). Is there any limit to get back those records(I mean Maximum how many days we can get those records).I used this query for get deleted records.  SELECT Id, Name FROM Account WHERE isdeleted = true ALL ROWS
121004
Hi i want to get the deleted records (records deleted from recycle bin of sales force).can any one help on this i tried this soql query retrive deleted records but its result showing error:  "SELECT Id, Name,ISDeleted  FROM lead WHERE ISDeleted = true"
93615
I am trying to delete all the duplicates but keeping single record only (shorter id). Following query deletes duplicates but take lot of iterations to delete all copies and keeping original ones. DELETE FROM emailTable WHERE id IN (  SELECT * FROM (     SELECT id FROM emailTable GROUP BY email HAVING ( COUNT(email) &gt; 1 )  ) AS q )  Its MySQL. DDL CREATE TABLE `emailTable` (  `id` mediumint(9) NOT NULL auto_increment,  `email` varchar(200) NOT NULL default '',  PRIMARY KEY  (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=298872 DEFAULT CHARSET=latin1
105574
person in distress here.  Dont ask me how, but I ended up deleting all my 12,000 inbox emails from Gmail into Trash and then erased my Trash as well. Gmail gave me a warning box and took 20 seconds to delete. This was not what I intended. I have searched high and low to check if there is any way of recovering my 10 years worth of emails and could not find any.  Any one here know of a way, ANY WAY, to recover my accidental permanent deletion of all my 10 years worth of email (deleted from Trash as well)?
20571
Whenever I need to return a random record from my tables and performance matters, instead of:  SELECT column FROM table ORDER BY random() LIMIT 1;   I always do:  SELECT column FROM table TABLESAMPLE BERNOULLI(1) LIMIT 1;   This is much faster but it seems like it's not very random? It looks like a lot of the same records get returned when using this method repeatedly. Is it just me or is this method much less random (and less useful because of that)?
115371
Is it possible to build a single mysql query (without variables) to remove all records from the table, except latest N (sorted by id desc)?  Something like this, only it doesn't work :)  delete from table order by id ASC limit ((select count(*) from table ) - N)   Thanks.
16831
I want to create a trigger to check what is being deleted against business rules and then cancel the deletion if needed. Any ideas?  The solution used the Instead of Delete trigger. The Rollback tran stopped the delete. I was afraid that I would have a cascade issue when I did the delete but that didn't seem to happen. Maybe a trigger cannot trigger itself.
57156
I know that most files, when deleted, aren't actually removed from the disk, and can be recovered later.  How can I ensure that a directory I had deleted will actually be removed from the disk? Are there utilities for that?  I'm using Debian Linux.
29359
Is it possible to recover an email that has been clicked on "delete forever" in the trash folder? I have accidentally clicked delete forever for an email but now I need to recover it.
24654
Is there any performance difference between these two queries?  select name from Account where id = :myId  select name from Account where id = :myId limit 1   Or, I guess more general: does salesforce stop searching after first hit when there's a unique value as a condition?
10894
What's the difference between TRUNCATE and DELETE in SQL?  If your answer is platform specific, please indicate that.
94747
Let's say there is a list with very large number of records. Now applying a particular filter on a list also retrieves very large number of items, more than threshold value. Retrieving list item is creating performance issue. Now, server side code is not permitted, only client side code is permitted. How to tackle this issue? What steps should be taken?
117105
A query that is used to loop through 17 millions records to remove duplicates  has been running now for about 16 hours and I wanted to know if the query is stopped right now if it will finalize the delete statements or if it has been deleting while running this query? Indeed, if I do stop it, does it finalize the deletes or rolls back?  I have found that when I do a    select count(*) from myTable   That the rows that it returns (while doing this query) is about 5 less than what the starting row count was. Obviously the server resources are extremely poor, so does that mean that this process has taken 16 hours to find 5 duplicates (when there are actually thousands), and this could be running for days?  This query took 6 seconds on 2000 rows of test data, and it works great on that set of data, so I figured it would take 15 hours for the complete set.  Any ideas?  Below is the query:  --Declare the looping variable DECLARE @LoopVar char(10)       DECLARE      --Set private variables that will be used throughout       @long DECIMAL,       @lat DECIMAL,       @phoneNumber char(10),       @businessname varchar(64),       @winner char(10)      SET @LoopVar = (SELECT MIN(RecordID) FROM MyTable)      WHILE @LoopVar is not null     BEGIN        --initialize the private variables (essentially this is a .ctor)       SELECT          @long = null,         @lat = null,         @businessname = null,         @phoneNumber = null,         @winner = null        -- load data from the row declared when setting @LoopVar         SELECT         @long = longitude,         @lat = latitude,         @businessname = BusinessName,         @phoneNumber = Phone       FROM MyTable       WHERE RecordID = @LoopVar        --find the winning row with that data. The winning row means        SELECT top 1 @Winner = RecordID       FROM MyTable       WHERE @long = longitude         AND @lat = latitude         AND @businessname = BusinessName         AND @phoneNumber = Phone       ORDER BY         CASE WHEN webAddress is not null THEN 1 ELSE 2 END,         CASE WHEN caption1 is not null THEN 1 ELSE 2 END,         CASE WHEN caption2 is not null THEN 1 ELSE 2 END,         RecordID        --delete any losers.       DELETE FROM MyTable       WHERE @long = longitude         AND @lat = latitude         AND @businessname = BusinessName         AND @phoneNumber = Phone         AND @winner != RecordID        -- prep the next loop value to go ahead and perform the next duplicate query.       SET @LoopVar = (SELECT MIN(RecordID)      FROM MyTable     WHERE @LoopVar &lt; RecordID)     END
122524
I tried dropping a table and then when i viewed the recycle bin nothing was there in it . Earlier too i dropped tables many a times but I was surprised to find no objects whatsover in it . What's the deal ? [update]: i had tried    SHOW PARAMETER RECYCLEBIN;  Its VALUE column shows it  as ON . So fine here ! Then i droppped an existing table but still the command     Select object_name from recyclebin;  and any such retrieval of columns is showing NO ROWS SELECTED !! Also using flashback command  confirms that recyclebin is not having any such dropped tables !! So where are dropped tables going ? And one more thing : This time i tried using  ALTER SYSTEM SET RECYCLEBIN=ON;    Instead of Alter session    and sqlplus throws an error : Specified initialization parameter is not modifiable with this option  So, is this because  that i am working as a SYSTEM ?? i have not created any other USER as of now .
38204
I have a trigger that doesn't allow me to undelete a record from Recicle Bin in a certain case.   At the same time I also checks security in order to be sure that my user is allowed to Undelete a record, based on the isUndeletable feature of the object:    But the time I want to test it. How can I check the isUndeletable feature? Looking at Profiles and Permission Sets we are only allow to check the CRUD but nothing related to Undelete.  Thanks in advance,
41420
From a Windows workstation when I delete files over the network (e.g. a file share, server disk, etc) those files are never put into a trash can, either on my Windows workstation or on the server - they're instantly and permanently deleted. This has always sucked IMHO.  Is there a software that, in this scenario, puts the files into a trash can somewhere for easy undelete?  Maybe a Windows policy change, registry setting value, software utility, etc ?   -- Looking for a specific solution instead of general "Hey look into this, or try this". I'm convinced somebody has already solved this and can explain it. Thanks.
20307
I'm not sure if this gets the past date within the current day or if it only takes 30 or 31 days to it.  e.g.  If the current date is March 28th, 1 month ago must be February 28th, but what happen when it's March 30th?  Scenario  I want to backup some files each day, the script will save this files within the current date with $(date +%Y%m%d) format, like 20150603_bckp.tar.gz, then when the next month arrives, remove all those files within 1 month ago except the 1st's and the 15th's files, so this is my condition:  past_month = $(date -d "-1 month" +%Y%m%d) day = $(date +%d) if [ "$day" != 01 ] &amp;&amp; [ "$day" != 15 ] then     rm /path/of/files/${past_month}_bckp.tar.gz     echo "Depuration done" else     echo "Keep file" fi   But I want to know, what will happen when the date is 30th, 31th or even the past February example? It will keep those files? or remove day 1st files?  When it's 31th the depuration will execute, so if the past month only had 30 days, this will remove the day 1st file?   I hope I hinted.
99663
How can I set up a query to search for records that were modified in the last 15 minutes? This is being used in Jitterbit dataloader not using apex. From most posts I have seen this doesn't seem possible.  Another idea I had was use a formula that would mark a boolean field as true if record was modified in last 15 minutes. However, I had no luck with the formula either.  Does anyone have a workaround or solution?