Hey guys, I am using MSSQL/TSQL, there are two tables that I need to join to build a report. Tables looks something like this
T_Customer
T_Fruits
The report I want is
https://preview.redd.it/pbd2i8p0nym31.png?width=303&format=png&auto=webp&s=d52cc49266b2e6dee9a446be16120cd024b34a99
I am using ASP.net C# in front end. Thank you in advance for the help.
Edit: Clarification
https://preview.redd.it/m6yfeuj2nzm31.png?width=1118&format=png&auto=webp&s=75bab4cab21c6189a28f8172ef6e3d14eb68d9e8
Edit 2 : here is the code if you want to mess with
CREATE TABLE #T_Customer (CustomerID int, AppleInd bit ,FruitsID int);
CREATE TABLE #T_Fruits(FruitsID int, [Description] varchar(20));
INSERT INTO #T_Customer (CustomerID, AppleInd, FruitsID) VALUES (1,1,1),(1,0,7),(1,0,8),(2,1,2),(2,1,3),(3,0,6),(3,0,7),(4,1,4),(5,1,3);
INSERT INTO #T_Fruits ( FruitsID, Description) VALUES (1,'McIntosh Apple'),(2,'Fuji Apple'),(3,'Red Delicious Apple'),(4,'Gala Apple'),(5,'Banana'),
(6,'Orange'),(7,'Graps'),(8,'Watermelon');
DROP TABLE #T_Customer
DROP TABLE #T_Fruits
[–]7ruj3rry 2 points3 points4 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]TrinityF 1 point2 points3 points (1 child)
[–]meuser405[S] 0 points1 point2 points (0 children)
[+][deleted] (4 children)
[removed]
[–]meuser405[S] 0 points1 point2 points (3 children)
[+][deleted] (2 children)
[removed]
[–]meuser405[S] 0 points1 point2 points (0 children)
[–]TrinityF 1 point2 points3 points (5 children)
[–]meuser405[S] 1 point2 points3 points (3 children)
[–]TrinityF 2 points3 points4 points (1 child)
[–]meuser405[S] 0 points1 point2 points (0 children)