User Profile

Collapse

Profile Sidebar

Collapse
JohnK
JohnK
Last Activity: Nov 15 '06, 01:06 PM
Joined: Jul 19 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • JohnK
    replied to MS SQL Script Optimisation
    I havent tested this, as I'm lasy, but it should give the same result but a bit faster as its not creating and dropping tables


    SELECT TOP 10 WITH TIES p.ProductDescri ption, p.Price ,Count(s.Prod_I d)
    FROM Sales as s
    INNER JOIN Products AS p
    ON s.Prod_Id = p.Prod_Id
    WHERE s.DateNo >= '20060101'
    AND s.DateNo < '20060516'
    GROUP BY p.ProductDescri ption, p.Price
    ORDER BY Count(s.Prod_Id )...
    See more | Go to post

    Leave a comment:


  • I'm sure some one will correct me if I’m wrong but I don’t think this query will ever work in SQL Server, it does look like something that might run in access though.

    I’ve had problems like this before, Access loves adding in brackets () that just get in the way and confuse things in SQL Server. It also seams to list all the tables then join them in the FROM statement which is not s SQL thing either.

    I think your...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...