Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. how to write querry for exact given no

how to write querry for exact given no

Scheduled Pinned Locked Moved Database
tutorialdatabasesql-serversysadmin
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    developerit
    wrote on last edited by
    #1

    hi iam using sql server 2000 i have a table with fields itemkey nvarchar(50) amount money i want the querry when user enters any number like 1000 or 750 i want to display what are the itemkey and the amount equals to exactly 1000 can you give example which helps me

    J H 2 Replies Last reply
    0
    • D developerit

      hi iam using sql server 2000 i have a table with fields itemkey nvarchar(50) amount money i want the querry when user enters any number like 1000 or 750 i want to display what are the itemkey and the amount equals to exactly 1000 can you give example which helps me

      J Offline
      J Offline
      Johan Hakkesteegt
      wrote on last edited by
      #2

      I hope that I misunderstood your question or that you have simply never written sql before:

      SELECT itemkey, amount
      FROM a_table_with_fields
      WHERE amount = 1000

      My advice is free, and you may get what you paid for.

      1 Reply Last reply
      0
      • D developerit

        hi iam using sql server 2000 i have a table with fields itemkey nvarchar(50) amount money i want the querry when user enters any number like 1000 or 750 i want to display what are the itemkey and the amount equals to exactly 1000 can you give example which helps me

        H Offline
        H Offline
        Henry Minute
        wrote on last edited by
        #3

        Your question is not exactly clear. However, from what I think it means, what you need is one of the most basic of SQL statements SELECT ......WHERE ...... See here[^] for syntax etc.

        Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

        D 1 Reply Last reply
        0
        • H Henry Minute

          Your question is not exactly clear. However, from what I think it means, what you need is one of the most basic of SQL statements SELECT ......WHERE ...... See here[^] for syntax etc.

          Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

          D Offline
          D Offline
          developerit
          wrote on last edited by
          #4

          hi , i want the querry for a given parameter how much items amount equals to given parameter

          H L 2 Replies Last reply
          0
          • D developerit

            hi , i want the querry for a given parameter how much items amount equals to given parameter

            H Offline
            H Offline
            Henry Minute
            wrote on last edited by
            #5

            In that case the answer given by Johan should do that.

            Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

            1 Reply Last reply
            0
            • D developerit

              hi , i want the querry for a given parameter how much items amount equals to given parameter

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              The number of matching items can be obtained using the COUNT function:

              SELECT count(*) FROM a_table_with_fields WHERE amount = 1000

              :)

              Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


              If you want my opinion or comment, ask in a forum or on my profile page; I will not participate in frackin' Q&A


              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups