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 |
Mchael
Starting Member
3 Posts |
Posted - 2011-07-05 : 08:04:29
|
Hello, I imported the Software PAD File Database from http://paddatabase.net/download.html into Microsoft Access in a table called main:MAIN-----IDProgramNameProgram_category_ClassCategoryID <- I created this to create a one to many relation with a new table Category..I created two new tables: category and subcategory.Category--------IDCategoryNameI extracted all the values from the field Program_Category_Class on the left side of the :: delimiter into the Table Category. Data from Program_Category_Class looks like this:Program_Category_ClassBusiness::Accounting & FinanceGames & Entertainment::ActionBusiness::Accounting & FinanceBusiness::Databases & ToolsWhat I want to do is create a SQL Query which Updates the MAIN table with the Category ID from the Category table that is a LIKE (Left) match on Program_Category_Class. I will then modify the query for a right left match for the subcategory table.I tried something like this but get no result:UPDATE Main SET Main.category = (SELECT Category.IDFROM CategoryWHERE Category.CategoryName LIKE Main.Program_Category_Class+'%')WHERE (((Exists (SELECT Category.IDFROM CategoryWHERE Category.CategoryName LIKE Main.Program_Category_Class+'%'))<>False));As it is a public DB I can provide a copy of the database to anyone interested.Any assistance would be most appreciated. Thank you.-----Expert Windows Hosting Since 1997 - M6.Net |
|
|
|
|