Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9042265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T10:26:41+00:00 2026-06-16T10:26:41+00:00

I am building JSP application in which I want to do following operations on

  • 0

I am building JSP application in which I want to do following operations on specific table

  • Display Data
  • Delete Data

I’ve done displaying data, however:

How can I delete a row in database if the table does not have any primary key ? (Delete operation does not depends on any value of that row)

Suppose here is may table –>> mytemp
Here is the data

Name | RollNo
ABC  |  98
XYZ  |  76
ABC  |  98
XYZ  |  76

There is no key in this table and i want to delete 3 rd record. How can i do this ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T10:26:43+00:00Added an answer on June 16, 2026 at 10:26 am

    You can choose any available column you think most suitable: e.g.

    DELETE FROM table_name WHERE column_name  = 'valuse'    
    

    without column_name you can delete all rows only.

    column_name does not has to be primary key, but all rows with column_name = 'valuse' will be deleted.


    EDIT
    To delete:

      DELETE FROM table_name WHERE Name = 'ABC' AND  RollNo  = 98;       
    

    Name and RollNo may not be primary key.

    Delete only third row:

    DELETE FROM table_name  
    WHERE ('ABC',98) IN ( SELECT TOP 1 Name, Rollno 
                          FROM table_name 
                          ORDER BY Name,RollNo DES)   
    

    Second way: if TOP not works

    DELETE FROM table_name  
    WHERE ('ABC',98) IN ( SELECT  Name, Rollno 
                          FROM table_name 
                          ORDER BY Name,RollNo DES LIMT 1)   
    

    CAUTION: it will delete one, which one I am not sure.

    Give it a try!!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building simple application for myself in JSP which stores URL for me and
I want to build reusable JSP components for an application that I am building.
We're building a JSP web application, which runs inside the Apache Felix OSGi container
I am building a Struts2 web application which uses tiles however I have discovered
I'm building a Spring MVC web application with Tiles/JSP as the view technology. Previously
Building decent RIA data-intensive crud-like application is still hard. In spite of existence tons
I want to assemble a web module which looks like the following: src/main/java (has
I'm building my own JSP Tag Library which need to support some features that
I'm using Netbeans building a web application using Java, JSP that handle a database
I'm building an application using jsp's, servlets, and all that fun stuff. Right now,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.