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
  1. Home
  2. Database & SysAdmin
  3. Database
  4. SQL help needed

SQL help needed

Scheduled Pinned Locked Moved Database
databasehelpquestion
5 Posts 3 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.
  • J Offline
    J Offline
    jegastar
    wrote on last edited by
    #1

    Hi everybody, I hava a table like this: Table Name- TmpTbl id PD_Id Remark 1 1 Good 2 2 Bad 3 2 fair 4 3 Bad 5 3 Good In this i want the select query for the result like this: id PD_Id Remark 1 1 Good 2 2 Bad 4 3 Bad Can you help me? Regards, Jegastar D.

    P J 2 Replies Last reply
    0
    • J jegastar

      Hi everybody, I hava a table like this: Table Name- TmpTbl id PD_Id Remark 1 1 Good 2 2 Bad 3 2 fair 4 3 Bad 5 3 Good In this i want the select query for the result like this: id PD_Id Remark 1 1 Good 2 2 Bad 4 3 Bad Can you help me? Regards, Jegastar D.

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      In your example, just select where id = 1, 2 or 4. If you are looking for more complex behaviour, then you need to specify what it is that you are looking for, as we can't divine it from your example.

      Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world." Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that." Deja View - the feeling that you've seen this post before.

      1 Reply Last reply
      0
      • J jegastar

        Hi everybody, I hava a table like this: Table Name- TmpTbl id PD_Id Remark 1 1 Good 2 2 Bad 3 2 fair 4 3 Bad 5 3 Good In this i want the select query for the result like this: id PD_Id Remark 1 1 Good 2 2 Bad 4 3 Bad Can you help me? Regards, Jegastar D.

        J Offline
        J Offline
        jegastar
        wrote on last edited by
        #3

        Acctuly this is my table id PD_Id Remark 1 1 Good 2 2 Bad 3 2 fair 4 3 Bad 5 3 Good In this i want the select query for the following result id PD_Id Remark 1 1 Good 2 2 Bad 4 3 Bad

        J R 2 Replies Last reply
        0
        • J jegastar

          Acctuly this is my table id PD_Id Remark 1 1 Good 2 2 Bad 3 2 fair 4 3 Bad 5 3 Good In this i want the select query for the following result id PD_Id Remark 1 1 Good 2 2 Bad 4 3 Bad

          J Offline
          J Offline
          jegastar
          wrote on last edited by
          #4

          Id, PD_ID, Remark are the 3 fields that i have used in this table.

          1 Reply Last reply
          0
          • J jegastar

            Acctuly this is my table id PD_Id Remark 1 1 Good 2 2 Bad 3 2 fair 4 3 Bad 5 3 Good In this i want the select query for the following result id PD_Id Remark 1 1 Good 2 2 Bad 4 3 Bad

            R Offline
            R Offline
            Rob Graham
            wrote on last edited by
            #5

            There is (almost) nothing consistent or special about your desired result set (no specific visible relationship between the value of remark, id , PD_ID). The resultset can be produced with "select top 3 id,pd_Id,remark from table where Remark in ('Good','Bad') order by PD_Id ASC" But that does not seem particularly useful.

            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