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. i want to write a optimal query for a complex problem

i want to write a optimal query for a complex problem

Scheduled Pinned Locked Moved Database
databasehelpquestion
2 Posts 2 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.
  • M Offline
    M Offline
    mhd sbt
    wrote on last edited by
    #1

    Hi to all How can I write a query that get me this result: My table is : ColumnA ColumnB ColumnC ColumnD A1 B1 Can be any thing Can be any thing A1 B2 Can be any thing Can be any thing A1 0 Can be any thing Can be any thing A1 0 Can be any thing Can be any thing A3 1 Can be any thing Can be any thing I want to get this result after run a query: ColumnA ColumnB ColumnC ColumnD A1 B1 Can be any thing Can be any thing A1 0 Can be any thing Can be any thing A1 0 Can be any thing Can be any thing A3 1 Can be any thing Can be any thing If ColumnA have B1 and also have a row with B2 I want to just get A1 B1 Row How can I do this Thanks for any idea

    J 1 Reply Last reply
    0
    • M mhd sbt

      Hi to all How can I write a query that get me this result: My table is : ColumnA ColumnB ColumnC ColumnD A1 B1 Can be any thing Can be any thing A1 B2 Can be any thing Can be any thing A1 0 Can be any thing Can be any thing A1 0 Can be any thing Can be any thing A3 1 Can be any thing Can be any thing I want to get this result after run a query: ColumnA ColumnB ColumnC ColumnD A1 B1 Can be any thing Can be any thing A1 0 Can be any thing Can be any thing A1 0 Can be any thing Can be any thing A3 1 Can be any thing Can be any thing If ColumnA have B1 and also have a row with B2 I want to just get A1 B1 Row How can I do this Thanks for any idea

      J Offline
      J Offline
      Jorgen Andersson
      wrote on last edited by
      #2

      How should the query behave if you have a row with B2 but none with B1? Should the row with B2 be included or not?

      Wrong is evil and must be defeated. - Jeff Ello[^]

      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