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 8036471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:37:52+00:00 2026-06-05T02:37:52+00:00

Which of the following notations is better? SELECT id,name,data FROM table WHERE id =

  • 0

Which of the following notations is better?

SELECT id,name,data FROM table WHERE id = X

OR

SELECT id,name,data FROM table WHERE id = X LIMIT 1

I think it should not have “LIMIT”.

Thanks!

  • 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-05T02:37:54+00:00Added an answer on June 5, 2026 at 2:37 am

    If there is a unique constraint on id then they will be exactly the same.

    If there isn’t a unique constraint (which I would find highly surprising on a column called id) then which is better depends on what you want to do:

    • If you want to find all rows matching the condition, don’t use LIMIT.
    • If you want to find any row matching the condition (and you don’t care which), use LIMIT 1.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following which works in SQL Query Analyzer . select oh.* from
I have the following test data frame : test <- read.table(header = TRUE, text
I found the following which shows how to delete an attribute from XML in
I Have a object which the following field : boost::unordered_map<std::string, std::shared_ptr<Foo> > m_liste_; I
currently I have the following which parses a json api.. import simplejson import urllib2
I have a Spring Batch process which has following kind of code. <step id=step1
I have text documents like the following which contain single and multiple variables: title::
I have the following code which splits a string of numbers (separated by a
Which structure is created as following in Perl? my $self = { Name =>
I have a Guardfile which contains the following line: guard 'coffeescript', :input => 'js',

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.