March 9, 2009 at 2:36 AM
Hi friend,
public interface HttpServletRequest
extends ServletRequest
Extends the ServletRequest interface to provide request information for HTTP servlets.
The servlet container creates an HttpServletRequest object and passes it as an argument
to the servlet's service methods (doGet, doPost, etc).
Remove duplicate record :
MySQL remove duplicate
To remove duplicate entries in the MySQL database we can follow one of these following approach:
First approach is that we have to write three manual steps to create
the new backup table with unique entries then we will remove the older table and at
last we will rename the backup table with the same name of the older table that we have deleted.
Here is the explanation with the query :
To explain use we have to create a table which consists duplicate entries :
Query
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`username` varchar(50) default NULL,
`password` varchar(50) default NULL,
`email` varchar(50) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `users` */
insert into `users`(`id`,`username`,`password`,`email`)
values (1,'Ankur','ankur','
ankur@yahoo.com'),
(2,'Sam','sam','
sam@yahoo.com'),
(3,'Xavior','xavior','
xav@yahoo.com'),
(1,'Suman','suman','
suman@one.com');
select * from users;
Output
+----+----------+----------+-----------------+
| id | username | password | email |
+----+----------+----------+-----------------+
| 1 | Ankur | ankur |
ankur@yahoo.com |
| 2 | Sam | sam |
sam@yahoo.com |
| 3 | Xavior | xavior |
xav@yahoo.com |
| 1 | Suman | suman |
suman@one.com |
+----+----------+----------+-----------------+
4 rows in set (0.00 sec)
Now to remove duplicate entries we can execute following query:
Query
CREATE TABLE backup_table AS
SELECT * FROM users WHERE 1 GROUP BY id ;
DROP TABLE users;
RENAME TABLE backup_table TO users;
Output
+----+----------+----------+-----------------+
| id | username | password | email |
+----+----------+----------+-----------------+
| 1 | Ankur | ankur |
ankur@yahoo.com |
| 2 | Sam | sam |
sam@yahoo.com |
| 3 | Xavior | xavior |
xav@yahoo.com |
+----+----------+----------+-----------------+
Second approach to remove duplicate entries from the database table is
very simple and is extremely quick way to remove duplicates. Here is the query :
Query
ALTER IGNORE TABLE users ADD UNIQUE INDEX(id);
Output
+----+----------+----------+-----------------+
| id | username | password | email |
+----+----------+----------+-----------------+
| 1 | Ankur | ankur |
ankur@yahoo.com |
| 2 | Sam | sam |
sam@yahoo.com |
| 3 | Xavior | xavior |
xav@yahoo.com |
+----+----------+----------+-----------------+
In the above query we have added unique index for id.
Related Tutorials/Questions & Answers:
can u plz explain the http request methods - JSP-Servletcan u plz explain the
http request methods
can u plz explain http request methods? as well in jdbc...how to delete the duplicate records in database... ServletRequest
Extends the ServletRequest interface to provide
request information
Can u Look to the error plz - Java BeginnersCan u Look to the error plz this is my code
can u modify it
plz and give me the result of it when
u check it on eclipse or jcreator
plz and i will be more thankfull if
u do that :) , oh yeh one thing
can you draw a flag
Advertisements
can u plz try this program - Java Beginnerscan u plz try this program Write a small record management application for a school. Tasks will be Add Record, Edit Record, Delete Record, List Records.
Each Record contains: Name(max 100 char), Age, Notes(No Maximum Limit
how the answer is 13 can anyone explain plzhow the answer is 13
can anyone
explain plz public class that {
public static void main(String arr[])
{
int i=3;
int j=1;
while(i<4)
{
//j=i;
i=i+j/2;
}
System.out.println(i
plz help me any one as fast as u canplz help me any one as fast as
u can A thief Muthhooswamy planned... is the number of metres he
can jump (1<=climbUp<=10^10)
climbDown...
Sample Input 1: 10:1:1:{10}
Here Muthooswamy
can jump 10 metres height
plz explain me the output of program - Java Beginnersplz explain me the output of program Hi friends,
can u please
explain me the output of below program with proper explanation of each and every line...
Three integer variables(a,b,c) and three
methods have been defined
can any one explain thiscan any one
explain this class Clidder {
private final void flipper() {
System.out.println("Clidder");
}
}
public class Ex3 extends Clidder {
public final void flipper() {
System.out.println
can you explain ?can you
explain ? my dear
can you teel me the explaintion for this code
i need it
GregorianCalendar cal = new GregorianCalendar(y, m, 0...(); } }
iam
explain whole code exept this part
can you help
how can u reduce the size of textfield?how
can u reduce the size of textfield? how
can u reduce the size of textfield?
thanks in advance
import javax.swing.*;
public class ReduceTextField extends JFrame {
public static void main(String
Explain Transparent Persistence - HibernateExplain Transparent Persistence
Hi Friends,
Can u plz explain Transparent Persistence briefly Hi
Follow this link to find solution of your problem...
http://www.roseindia.net/jdotutorials/jdo
ModuleNotFoundError: No module named 'http_request' environment you have to install padas library.
You
can install
http_
request python...ModuleNotFoundError: No module named '
http_
request' Hi,
My Python... '
http_
request'
How to remove the ModuleNotFoundError: No module named '
JMeter HTTP request exampleJMeter
HTTP request example Concerning:
http://www.roseindia.net/jmeter/using-jmeter.shtml
how do I set path?
also what do i need to do to get the helloworld servlet work? Thanks in advance
plz anyone can solve myplz anyone
can solve my creat an applet prog which accepts the details of 10 customers like name , address , city , ect. and display it
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import
How to fireup HTTP request from JavaFX ClientHow to fireup
HTTP request from JavaFX Client Please tel me how do I
can fire
HTTP post
request from an JavaFX client.
Sceneario: I've an JavaFX... i've working version of JSP Code to handle
HTTP post
request tested by posting
JavaScript XML Http Request
JavaScript XML
Http Request
...;, url, true) to make a GET
request for the
given url 'data.xml'. It provides...
HTTP Request</h2>
<script type="text/javascript">
Java Servlet : Http Request HeadersJava Servlet :
Http Request Headers
In this tutorial, you will learn how to
Http Request Headers works in
java servlet.
Http Request Headers :
HTTP Request Header is a
request line text that a
HTTP client(eg. web
browser)sends
Retrieve HTTP Request Headers using JSP
Retrieve
HTTP Request Headers using JSP
... the
request headers.ADS_TO_REPLACE_1
When a
HTTP client sends a
request, it is required...;
request line
indicating
HTTP 1.1,
it may be able to take advantage
how to get HTTP GET request value using javascripthow to get
HTTP GET
request value using javascript how to get
HTTP GET
request value using javascript
how is how you
can get
HTTP GET
request value using javascript:
var parameter = window.location.search.replace
methodsmethods PrintStream class has two formatting
methods,what
methodsmethods PrintStream class has two formatting
methods,what
methodsmethods PrintStream class has two formatting
methods,what
How to get country locale from a http requestHow to get country locale from a
http request Hi,
I Have a requirement like , i need to get the country locale(from whcih country he is logged... to implement business logic.
Can anyone help me out to get this done.
any help
plz Help me - Java Beginnersplz Help me Hi,
I want learn struts,I dont have any idea about this
plz help how
can i make a framework.If
u have any information then
plz send my personal id
plz tell me that whose software installed.and give me brief
Specific Request Headers in JSPSpecific
Request Headers in JSP
Whenever an
http client sends a
request, it
can also sends
the headers with it. All the headers are optional except