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. Error on SQL server join

Error on SQL server join

Scheduled Pinned Locked Moved Database
databasequestionsql-serversysadminhelp
4 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
    DeveloperLife2015
    wrote on last edited by
    #1

    Hi All, I am trying to run this query on my database and I am getting an error Incorrect syntax near the keyword 'JOIN'. USE IVRCallCenterTest Go SELECT * FROM dbo.OutputPromptItem WHERE SegmentId=7198 JOIN dbo.OutputPrompt ON dbo.OutputPromptItem.PromptId=dbo.OutputPrompt.PromptID Go what is wrong with my code ? Thanks in advance

    S A A 3 Replies Last reply
    0
    • D DeveloperLife2015

      Hi All, I am trying to run this query on my database and I am getting an error Incorrect syntax near the keyword 'JOIN'. USE IVRCallCenterTest Go SELECT * FROM dbo.OutputPromptItem WHERE SegmentId=7198 JOIN dbo.OutputPrompt ON dbo.OutputPromptItem.PromptId=dbo.OutputPrompt.PromptID Go what is wrong with my code ? Thanks in advance

      S Offline
      S Offline
      s_magus
      wrote on last edited by
      #2

      Your Where clause needs to come after From.

      USE IVRCallCenterTest
      Go

      SELECT *
      FROM dbo.OutputPromptItem JOIN
      dbo.OutputPrompt ON OutputPromptItem.PromptId = OutputPrompt.PromptID
      WHERE SegmentId = 7198
      Go

      1 Reply Last reply
      0
      • D DeveloperLife2015

        Hi All, I am trying to run this query on my database and I am getting an error Incorrect syntax near the keyword 'JOIN'. USE IVRCallCenterTest Go SELECT * FROM dbo.OutputPromptItem WHERE SegmentId=7198 JOIN dbo.OutputPrompt ON dbo.OutputPromptItem.PromptId=dbo.OutputPrompt.PromptID Go what is wrong with my code ? Thanks in advance

        A Offline
        A Offline
        Aner Bautista
        wrote on last edited by
        #3

        Hello The [WHERE] filter is in the wrong place. Try this (see the [WHERE] location?):

        SELECT *
        FROM dbo.OutputPromptItem
        JOIN dbo.OutputPrompt
        ON dbo.OutputPromptItem.PromptId=dbo.OutputPrompt.PromptID
        WHERE SegmentId=7198

        1 Reply Last reply
        0
        • D DeveloperLife2015

          Hi All, I am trying to run this query on my database and I am getting an error Incorrect syntax near the keyword 'JOIN'. USE IVRCallCenterTest Go SELECT * FROM dbo.OutputPromptItem WHERE SegmentId=7198 JOIN dbo.OutputPrompt ON dbo.OutputPromptItem.PromptId=dbo.OutputPrompt.PromptID Go what is wrong with my code ? Thanks in advance

          A Offline
          A Offline
          AANIL DHAKAD
          wrote on last edited by
          #4

          You should use Where Clause at End of Statement Like

          SELECT *
          FROM dbo.OutputPromptItem
          JOIN dbo.OutputPrompt
          ON dbo.OutputPromptItem.PromptId=dbo.OutputPrompt.Promp WHERE SegmentId=7198

          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