Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with another query
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01085334
Message ID:
01085340
Vues:
15
Try
... 
	count(DISTINCT det.meetingnumber) as CaseCounter
...
>I'm using SQL Server 2000, and I thought I had this, but I was wrong, the following query returns everything I need with the exception of the casecounter. In the query below, I'm trying to return all the the items used by a physician grouping it by the procedure done and surgeon (here I'm limiting it to one for testing purposes) including returning the number of cases the data is pulled from (distinct meetingnumber). In my example, there should 5, my casecounter field is return various values on each record that range from 1 to 5. I'm assuming that it is returning how many cases that item was used on instead of the total of of procedures (of that type)for that surgeon.
>
>Procedure      physician     item           casecnt
>CABG           DOCTOR A        ITEM 1         5
>CABG           DOCTOR A        ITEM 2         5
>
<snip>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform