A) suppose a table. that i want to perform a DELETE function on .
This is done in ms access 2003 sql query. NOTE There are many many many many entries. in the few hundred thousand … to million ranges.so hopefully if there can be a code that deals well with a large dataset. there is 3 types of mood only.
DayNumber Mood
1 Mad
2 Sad
2 Happy
2 Sad
3 Sad
3 Happy
when there are a few moods in one day we only want to keep the most important one.
so lets have a delete function delete for duplicates of days . first deleting the less important moods. importance of moods is Happy>Mad>Sad. So I want:
DayNumber Mood
1 Mad
2 Happy
3 Happy
B) I was first starting at easier without three options for mood jsut two . where Happy>Sad
DayNumber Mood
1 Sad
2 Sad
2 Happy
3 Sad
3 Happy
Where I will Ideally get
DayNumber Mood
1 Sad
2 Happy
3 Happy
It doesnt matter whether you do the first example or secodn for me I’m stuck either way !
This is what i have for the second question so far.. btu it doesnt work cuz i have an aggregate function in the where clause .
DELETE FROM Table
WHERE (Mood='Sad') and (COUNT(DayNumber)=2);
If you have a small & fixed number of moods, you can hardwire the hierarchy like so: