iterating and comparing rows

S

Shum

Hi!
i am working on a hospital data base. i have two tables Administration
and knowlege base.
in Administration i have columns ID, NumberOfDoctors etc, and in
KnowlegeBase i have some similar columns but ofcourse differnet data.

Administration
ID Date HospitalName
NumberOfDoctors .........................
71 4/6/2007 Children Hospital
378 .........................
153 4/19/2007 MH 600
207 4/20/2007 Our Hospital 100
227 4/15/2007 My Hospital 30
313 4/11/2007 Hospita 150
576 4/17/2007 Health Ways 80

KnowlegeBase
ID NumberOfDoctors NumberOfBeds
AvgPatPerDoc .....................
1 378
1500 20 ...........

I now want to compare and iterate through the rows of
Administration.NumberOfDoctors with KnowlegeBase.NumberOfDoctors..
and i dont know how to do it.
Got me??

(using sql server2005 and c#)
 
D

DeveloperX

Hi!
i am working on a hospital data base. i have two tables Administration
and knowlege base.
in Administration i have columns ID, NumberOfDoctors etc, and in
KnowlegeBase i have some similar columns but ofcourse differnet data.

Administration
ID Date HospitalName
NumberOfDoctors .........................
71 4/6/2007 Children Hospital
378 .........................
153 4/19/2007 MH 600
207 4/20/2007 Our Hospital 100
227 4/15/2007 My Hospital 30
313 4/11/2007 Hospita 150
576 4/17/2007 Health Ways 80

KnowlegeBase
ID NumberOfDoctors NumberOfBeds
AvgPatPerDoc .....................
1 378
1500 20 ...........

I now want to compare and iterate through the rows of
Administration.NumberOfDoctors with KnowlegeBase.NumberOfDoctors..
and i dont know how to do it.
Got me??

(using sql server2005 and c#)

It's not clear what you're trying to achieve or how the two tables
relate. But isn't this more of a SQL issue? For example if
knowledgebase has a foreign key to hospital, or knowledgebase.ID maps
directly to administration.id, why not create a view which joins the
two tables and load that into a dataset? If you're only interested in
differences, you could filter out matches in the view rather than
bring all the data over. Are there aggregates?
 
S

Shum

The thing is that i want to compare the records of
administration.numberofdoc with knowlegebase.numberofdocs... knowlege
base has all the facts and actual figures whereas other other tables
dont.. so the records of thosse tables needs to be compared. wud do
that with if staements etc.... I thinkk that could be achieved through
dataset.. will work on it tonight..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top