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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-03-04 : 13:55:18
|
| Lady writes "Hi!!I have table like this:stateid logid(+) recorddate(now)1 1232 124 2 1253 1264 1274 1285 1295 130.........I need get only this records, that have been changed :1 1232 1243 1264 1275 129 i think, i have to use nested query, but i can't get true resulthelp me please..." |
|
|
AjarnMark
SQL Slashing Gunting Master
3246 Posts |
Posted - 2002-03-04 : 15:14:51
|
quote: I need get only this records, that have been changed :
How do you know which ones have been changed? It looks like you have a date field defined (recorddate) but no sample data for that column provided. Are you looking for all records that have a recorddate >= some selected date value? Then that would be a simple WHERE clause. Or how else do you know which records "have been changed"?------------------------GENERAL-ly speaking... |
 |
|
|
yakoo
Constraint Violating Yak Guru
312 Posts |
Posted - 2002-03-04 : 16:03:18
|
| if you just want to know which records have been changed then run a distinct query. if you need logid you are going to have to group by stateid and then use the max(recorddate) to get the logid as well. Otherwise if you are looking for any records that have changed after a certain date then you include a where clause on with your distinct query. |
 |
|
|
|
|
|