Is it possible to make a query like this?

  • Thread starter Thread starter Eph0nk
  • Start date Start date
E

Eph0nk

Hi,

My question is SQL/.NET (datatables) related.

One of my customers have asked for something - but I don't know if this is
possible. It seems logical, but I can't find a way to do it:

Basics:
I need to make a report, that shows the members and their related "interest"
fields in one row.
There are two tables: One with the info about the members, and one with the
interests (ie: memberid + free textfield with one interest of that member..
each members can have a multitude of non-fixed "interests").

This report needs to be in excel, so I generate it with .NET.
I start out by reading the members (using the conditions stated by the
program) - and creating a datatable in memory. Then I go to retrieve each
field of interest for each member. If a "new" field of interest is found
(that didn't exist before) - i create a new datacolumn.
This is the part that works.

What doesn't work, is when a member has more then one interest, to mark it
in the existing table.
I have provided a scheme of what it currently does, and what it needs to do.
You can find it here: http://www.s-data.be/temp/problemsql.gif
As you can see, the member currently gets listed more then once, if he has
more then one fields of interest.

Any suggestions are more then welcome.
 
Hi,

Retrieve interests for a member(s) to a separate table, and insert them
manually into your main table.
 
So it isn't possible by using the query "FROM members L LEFT JOIN
membersinterst M ON L.LidId = M.led_id" ?
Because I think manual retrieving might be a serieous performance hit, not?
---
Tim De Vogel
S-Data NV


Miha Markic said:
Hi,

Retrieve interests for a member(s) to a separate table, and insert them
manually into your main table.
 
Hi,

Yes, it is possible.
In either ways you'll have to manually adjust the DataTable.

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

Eph0nk said:
So it isn't possible by using the query "FROM members L LEFT JOIN
membersinterst M ON L.LidId = M.led_id" ?
Because I think manual retrieving might be a serieous performance hit, not?
---
Tim De Vogel
S-Data NV


Miha Markic said:
Hi,

Retrieve interests for a member(s) to a separate table, and insert them
manually into your main table.
this
is with
the
mark
 
Back
Top