Re: Counting things with SQL

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"Jens Süßmeyer" wrote
> Here is an example for the Northwind database, can be easely compared to
> your database with the right key associated.
>
> Select O.OrderID,Count(*) from Orders O
> Inner join [Order Details] OD
> On O.OrderID = OD.OrderID
> Group by O.OrderIDa

Thanks for that - is the next line meant to be included in the script
somehow?
Is it intended to modify the above query to return only the largest value?

> Count All Orders Group by the OrderID

[Also, is the Northwind database available to those of us who only have MSDE
to experiment with? So many Microsoft examples use it, but without it it can
be hard to follow the examples.]

Andrew


.



Relevant Pages

  • Re: Counting things with SQL
    ... Here is an example for the Northwind database, ... Inner join OD ... Count All Orders Group by the OrderID ... > I would like to find the size of the basket with the most items in. ...
    (microsoft.public.sqlserver.msde)
  • RE: SSRS2008 Samples
    ... The problem is this the right database to drive the SSRS2008 ... In the sql server object explorer: I have AdventureWorksLT. ... sales, Invalid Production.ProductSubcategory. ... FROM Production.ProductSubcategory PS INNER JOIN ...
    (microsoft.public.sqlserver.setup)
  • Re: Data generator help!!
    ... in c# to populate the database (sql server 2005), ... the database, then get the data type of the coulumn, if the data type ... FROM sysobjects SO JOIN syscolumns SC ON SO.id = SC.id INNER JOIN ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: AutoLookup Query doesnt autofill my fields
    ... You might want to look at the Order Details subform in the Northwind ... > this database for me and I'm not sure how to get out of that situation. ... >> MS Access MVP ... >>> sure they autofill, but when I enter new data, the other fields don't ...
    (microsoft.public.access.queries)
  • RE: Subquery help?
    ... in our desire to normalize our database or make it more "elegant" ... the subquery fails. ... AS ENDDATE FROM tbl_Hours AS t1 INNER JOIN ...
    (microsoft.public.access.queries)