All,
I need a little help understanding which concepts / functions /
methods / strategies I should use to accomplish what I'll describe
below. Note - the real implementation isn't about music - I just
thought it would be easier to understand, if not more fun to think
about.
I have a table with 8,000 rows. Let's call that the "TBL_Fav_So ngs"
table. It contains a list of my favorite songs, in the column |
MyFavs|.
I have a table with 117,000 rows. Let's call that the
"TBL_All_Albums " table. It contains a list of albums in my music
library. The table has three columns - |Album|Songs|Fa vSongs|
|Album| contains the Album name.
|Songs| contains the songs on an album, in a text field - all songs
listed together in one field.
|FavSongs is empty at the moment.
I want to wind up with a table in which FavSongs is populated with the
names of songs that are my favorites, for each album listed.
I need to search the |Songs| field of the "Albums" table, for matches
from the songs listed in the |MyFavs| column in the "TBL_Fav_So ngs"
table.
Wherever I find a match, I want to populate the |FavSongs| field.
There can be multiple matches per album, and a song can be on multiple
albums ($%^& annviersary reissues!).
I think I'm going to need to use nested loops, and have a routine that
fills in the |FavSongs| field, appending new values to the field as it
finds matches. I guess I don't know whether to search one row in the
"TBL_All_Albums " table for matches to every row in the "TBL_Fav_So ngs"
table, or to search all of the rows in the "TBL_All_Albums " table for
matches to one row in the "TBL_Fav_So ngs" table.
Suggestions, including a good resource for learning how to do this?
Thanks,
Patrick
I need a little help understanding which concepts / functions /
methods / strategies I should use to accomplish what I'll describe
below. Note - the real implementation isn't about music - I just
thought it would be easier to understand, if not more fun to think
about.
I have a table with 8,000 rows. Let's call that the "TBL_Fav_So ngs"
table. It contains a list of my favorite songs, in the column |
MyFavs|.
I have a table with 117,000 rows. Let's call that the
"TBL_All_Albums " table. It contains a list of albums in my music
library. The table has three columns - |Album|Songs|Fa vSongs|
|Album| contains the Album name.
|Songs| contains the songs on an album, in a text field - all songs
listed together in one field.
|FavSongs is empty at the moment.
I want to wind up with a table in which FavSongs is populated with the
names of songs that are my favorites, for each album listed.
I need to search the |Songs| field of the "Albums" table, for matches
from the songs listed in the |MyFavs| column in the "TBL_Fav_So ngs"
table.
Wherever I find a match, I want to populate the |FavSongs| field.
There can be multiple matches per album, and a song can be on multiple
albums ($%^& annviersary reissues!).
I think I'm going to need to use nested loops, and have a routine that
fills in the |FavSongs| field, appending new values to the field as it
finds matches. I guess I don't know whether to search one row in the
"TBL_All_Albums " table for matches to every row in the "TBL_Fav_So ngs"
table, or to search all of the rows in the "TBL_All_Albums " table for
matches to one row in the "TBL_Fav_So ngs" table.
Suggestions, including a good resource for learning how to do this?
Thanks,
Patrick
Comment