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. How can i run a Delete Statement from the following Query

How can i run a Delete Statement from the following Query

Scheduled Pinned Locked Moved Database
csharpdatabasecomquestion
3 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.
  • V Offline
    V Offline
    Vimalsoft Pty Ltd
    wrote on last edited by
    #1

    Good Morning All u have the Following Query that Display me the records. select ps.Lis_key as [Celeste],p.Lis_key as [Pro-v], p.Attrib_code,p.Func_key from dbo.Check_LIS ps inner join Tshwane_Valuations.sde.Property p on ps.Lis_key = p.Lis_key where ps.Lis_key = p.Lis_key And Substring(p.Attrib_code,5,2)='16' OR p.Attrib_code = '0009000900' so i want Delete the records returned by this Query. please Explain how you do it when you give me a code. Thanks

    Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za

    D 1 Reply Last reply
    0
    • V Vimalsoft Pty Ltd

      Good Morning All u have the Following Query that Display me the records. select ps.Lis_key as [Celeste],p.Lis_key as [Pro-v], p.Attrib_code,p.Func_key from dbo.Check_LIS ps inner join Tshwane_Valuations.sde.Property p on ps.Lis_key = p.Lis_key where ps.Lis_key = p.Lis_key And Substring(p.Attrib_code,5,2)='16' OR p.Attrib_code = '0009000900' so i want Delete the records returned by this Query. please Explain how you do it when you give me a code. Thanks

      Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za

      D Offline
      D Offline
      Dobromir Dimitrov
      wrote on last edited by
      #2

      Why don't you try this: delete from dbo.Check_LIS where Lis_key in( select ps.Lis_key from dbo.Check_LIS as ps inner join Tshwane_Valuations.sde.Property as p on ps.Lis_key = p.Lis_key where substring (p.Attrib_code, 5, 2) = '16' or p.Attrib_code = '0009000900' ) Also you don't need to add ps.Lis_key = p.Lis_key in the where clause since you use inner join on the same fields. I hope this was helpful. Best wishes, Dobromir.

      V 1 Reply Last reply
      0
      • D Dobromir Dimitrov

        Why don't you try this: delete from dbo.Check_LIS where Lis_key in( select ps.Lis_key from dbo.Check_LIS as ps inner join Tshwane_Valuations.sde.Property as p on ps.Lis_key = p.Lis_key where substring (p.Attrib_code, 5, 2) = '16' or p.Attrib_code = '0009000900' ) Also you don't need to add ps.Lis_key = p.Lis_key in the where clause since you use inner join on the same fields. I hope this was helpful. Best wishes, Dobromir.

        V Offline
        V Offline
        Vimalsoft Pty Ltd
        wrote on last edited by
        #3

        Thanks man it was very easy Thanks

        Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za

        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