|
-
Sep 6th, 2017, 03:47 PM
#1
Creating a linked list of results?
I have a table with metadata in it that I need to present two separate but related lists for.
Code:
Table1
-----
id | value
1 | Employee_Edited
2 | Employee_Created
3 | Employee_Deleted
4 | Manager_Hired
5 | Manager_Fired
Now I have used sql functions to parse "Employee_Edited" into "Employee", "Edited":
Code:
sql query results
-----------
id | value | valueOnly | actionOnly
1 | Employee_Edited | Employee | Edited
2 | Employee_Created | Employee | Created
3 | Employee_Deleted | Employee | Deleted
4 | Manager_Hired | Manager | Hired
5 | Manager_Fired | Manager | Fired
Now I figured I could add a Distinct query and have just the "Employee" in a list but at some point I need to display the list on the webpage with each associated action. Note not all values will have the same actions.
Results 1
-----------
Employee
Manager
Then when the user selects Manager the second list will propagate to display:
Results 2
----------
Hired
Fired
I don't want to have a second db call as that would be the obvious way to solve this but not the best for performance imo.
Whats the best way to write the query for this? Using SQL and JavaScript on an MVC website
Thanks
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|