
#handle #relationship #varying #number #columns #needed LEFT OUTER JOIN dbo.Friend AS F ON F.FriendID = HF.FriendID LEFT OUTER JOIN dbo.HikeFriend AS HF ON HF.HikeID = H.HikeID , FriendID INT NOT NULL REFERENCES dbo.Friend (FriendID)ĬREATE UNIQUE INDEX IDXU_HikeFriend ON dbo.HikeFriend (HikeID, FriendID) , HikeID INT NOT NULL REFERENCES dbo.Hikes (HikeID) HikeFriendID INT NOT NULL PRIMARY KEY IDENTITY(1,1) HikeID INT NOT NULL PRIMARY KEY IDENTITY(1,1)įriendID INT NOT NULL PRIMARY KEY IDENTITY(1,1) I’ve included a sample below as well as a sample query that shows each hike and the friends that have gone on that with you. Then join through that table to list off friends who have gone on which hikes. Once the driver for your source is installed, you can follow these steps to use the external data in a PivotTable:Īdd the data source for your database, and then click OK.The preferred method is to use an intermediate table to just intersect friends and hikes.


Information on drivers is available on this web page. If you want to use an external source that is not a SQL Database, you will need an Open Database Connectivity (ODBC) driver installed on your Mac. Add, remove, or move the fields as you see fit. In the Import Data dialog box, click PivotTable, and then click OK.Įxcel creates an empty PivotTable and displays the PivotTable Builder. When you're ready to bring the data into Excel, click Return Data. To get a preview of what the data will look like, click Run. Then click the name of the table you want. On the left, click the arrow next to the server to see the databases.Ĭlick the arrow next to the database you want. Get the server information from your database administrator, and type it in this dialog box.

The Connect to SQL Server ODBC Data Source dialog box appears. On the Data tab, click New Database Query

You can use an external data source, but it depends on the type of source. Use an external data source to create a PivotTable In this case, you connect to the external data source first, and then use a PivotTable to summarize, analyze, explore, and present that data. Sometimes you need a PivotTable for data that is stored outside of Excel, like in a database. Excel for Microsoft 365 for Mac Excel 2021 for Mac Excel 2019 for Mac Excel 2016 for Mac More.
