• Sneaky.

    Reminds me of the advice when reading program code (any language) ...

    "Don't trust the comments (or formatting?). Read the code!"

    Sagesh (12/13/2007)


    I tried this query in SQL SERVER 2005,It's giving some error.It's a SQL SERVER 2008 feature?

    Thanks & Regards

    Sagesh.K

    Worked fine for me in 2K5.

    use scratch

    --drop table customers

    --drop table employees

    create table customers (customerid int, name varchar(10))

    create table employees (employeeid int, name varchar(10))

    insert customers (customerid, name)

    select 1,'Dave' union all

    select 2,'John' union all

    select 3,'Tom' union all

    select 4,'Dick' union all

    select 5,'Harry'

    insert employees (employeeid, name)

    select 2,'John' union all

    select 4,'Dick' union all

    select 6,'Anne' union all

    select 8,'Martha'

    GO

    SELECT *

    FROM dbo.Customers

    MIDDLE JOIN dbo.Employees ON CustomerID = EmployeeID

    Derek