MS SQL Server Management Studio

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bonnie Smith
    New Member
    • Jul 2011
    • 1

    MS SQL Server Management Studio

    How can I fix this?
    Msg 102, Level 15, State 1, Line 3
    Incorrect syntax near '.'.

    USE Northwind
    SELECT * FROM Employees
    Employees.First Name AS e.FirstName,
    Employees.LastN ame AS e.LastName,
    ReportsTo. FirstName AS rt.FirstName,
    ReportsTo. LastName AS rt.LastName
    FROM Employees e JOIN ReportsTo rt
    ON e.rt=Employees JOIN.EmployeeID
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    There's a lot wrong with the query string. First off, you are selecting fields in two different places. Second, when you give an alias to a table, you can no longer qualify the table with the original name. Third, you have join in there twice, the second time is extraneous and incorrect.

    If you're having this much trouble with a basic SQL query, you should find a good tutorial before jumping into it.

    Comment

    Working...