I tried looking for this question, but found nothing relevant. So here goes...
I have three tables, the extremely simplified versions of which are:
Practitioners:
practitioner_id :: intname :: nvarchar
Insurances:
insurance_id :: intname :: nvarchar
InsuranceLink:
practitioner_id :: intinsurance_id :: int
So, the practitioner table contains a list of practitioners, the insurance table contains a list of insurances, and the link table represents which practitioner supports which insurance.
Now, I need to create a view which can display the information like this:
ViewTable:
practitioner_id :: intpractitioner_name :: nvarcharinsurance_1 :: bitinsurance_2 :: bit.....insurance_100 :: bit
In other words, the columns in the view are the ID and name of the practitioner, and every insurance that exists in Insurances (with the insurance name as the column name (there is an enforced condition that insurance names are unique)). The cells in the insurance columns will indicate if that practitioner supports that insurance.
Is there any way of doing this?
Or better yet, is it possible to use an excel-style pivot table on a DataSet in a VB.NET form? That would also solve many of my problems.