Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 sorting and grouping data

Author  Topic 

darkental
Starting Member

1 Post

Posted - 2012-11-12 : 11:36:10
I´ve been having problems with organizing some data, I have to get the time of arrival and exit from a place for each person on a database, and there is many people and places so is a bit complicated

as an example of only one person:

TIME //ORDER//TAG//LOCATION
09:00:00.000// 1 // 1 // 1000 <----
09:01:00.000// 2 // 1 // 1000
09:02:00.000// 3 // 1 // 1000
09:03:00.000// 4 // 1 // 1000 <----
09:04:00.000// 5 // 1 // 1001 <----
09:05:00.000// 6 // 1 // 1001
09:06:00.000// 7 // 1 // 1001 <----
09:07:00.000// 8 // 1 // 1000 <----
09:08:00.000// 9 // 1 // 1000
09:09:00.000// 10 // 1 // 1000 <----
09:10:00.000// 11 // 1 // 1010 <----
09:11:00.000// 12 // 1 // 1010 <----


so TAG is the person and I need to get from a query only the data with an arrow, I´ve been trying with group by, where and/or and anything I could think

does anyone know how to do this?



sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-11-12 : 12:14:10
What is the rule you are using to determine that TAGs 1,4,5,7,8,10,11, and 12 should be picked, but not the other tags? None of the columns seem to give a clue as to why these are preferred over the others.
Go to Top of Page
   

- Advertisement -