Question: I have a link on the page that opens a contact form in a modal window. 

How can I verify that the user clicked on the link to access the contact form, and did not go to the page directly. I don't want users or bots inadvertently browsing to that page.

Thanks in advance!

Answer: 
You need a way to distinguish the rows. Based on your comment, you could use the special [rowid column](http://www.sqlite.org/autoinc.html) for that.

To delete duplicates by keeping the lowest `rowid` per `(hash,d)`:

```
delete   from YourTable
where    rowid not in
         (
         select  min(rowid)
         from    YourTable
         group by
                 hash
         ,       d
         )

```
The proposed solution was not working for me, so I ended up doing this:

```sql
CREATE TABLE temp_table as SELECT DISTINCT * FROM your_table
DROP TABLE your_table
ALTER TABLE temp_table RENAME TO your_table

```