Reply to Re: Tough query?

Your name:

Reply:


Posted by jsfromynr on 08/07/06 08:17

Hi There,
I think IF out of this sample data you are gathering info of total how
many visits have been made (excluding duplicate visits by emp)

VISITID,BLDGCODE,VISITDATE,EMPID,VISITCODE
1, BLDG1, 10/18/2005, 128, V6
2, BLDG1, 10/18/2005, 128, V9
3, BLDG2, 1/24/2006, 128, V8
4, BLDG2, 1/24/2006, 165, V22
5, BLDG3, 2/15/2006, 13, V14

Select BLDGCODE,VISITDATE ,Count(Distinct EMPID)
From
YourTable
Group By BLDGCODE,VISITDATE

Result :
BLDG1 10/18/2005 1
BLDG2 1/24/2006 2
BLDG3 2/15/2006 1


I hope this helps.

With Warm regards
Jatinder Singh
http://jatindersingh.blogspot.com
http://sqloracle.tripod.com

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация