Click here to Skip to main content
15,891,734 members
Home / Discussions / Database
   

Database

 
GeneralRe: select before and after question Pin
Not Active13-Mar-10 11:46
mentorNot Active13-Mar-10 11:46 
GeneralRe: select before and after question Pin
Eli Nurman13-Mar-10 12:09
Eli Nurman13-Mar-10 12:09 
GeneralRe: select before and after question Pin
Mycroft Holmes13-Mar-10 20:27
professionalMycroft Holmes13-Mar-10 20:27 
Questionneed help in building this view, please Edited to add results of trying RIGHT OUTER JOIN Pin
Michael J. Eber12-Mar-10 10:39
Michael J. Eber12-Mar-10 10:39 
AnswerRe: need help in building this view, please Edited to add results of trying RIGHT OUTER JOIN Pin
Mycroft Holmes12-Mar-10 16:52
professionalMycroft Holmes12-Mar-10 16:52 
GeneralRe: need help in building this view, please Edited to add results of trying RIGHT OUTER JOIN Pin
Michael J. Eber15-Mar-10 7:47
Michael J. Eber15-Mar-10 7:47 
GeneralRe: need help in building this view, please Edited to add results of trying RIGHT OUTER JOIN Pin
i.j.russell15-Mar-10 9:31
i.j.russell15-Mar-10 9:31 
QuestionGetting SP results from a table with multiple rows for same ID [modified] Pin
DeepToot12-Mar-10 9:37
DeepToot12-Mar-10 9:37 
I have a stored procedure that is used with a Search form we have. Search form has about 15 parameters it can take, all optional.

The database is a mess and im stuck working around it so bare with me while I try to explain my issue. There are more issues but want to focus on the Buyer/Seller issue for now.

The long and short of my problem is this - the data entry form has fields for { Buyer First Name, Buyer Last Name, Seller First Name, Seller Last Name}

These will be inserted into table BuyerSeller (for instance)
The schema for this:
BuyerSellerID | FirstName | LastName

this table is holds both Buyer and Seller information. So what we end up with is:
<br />
BuyerSellerID | FirstName   | LastName<br><br />
   100           | BuyerFirst  | BuyerLast<br><br />
   101           | SellerFirst |  SellerLast<br />


But now the issue comes into play when he created an index lookup table called BuyerSellerInfo that includes:
<br />
BuyerorSellerInfoID (primary key) | MortgageID | BuyerID | SellerID<br />



What the original developer did was put the Buyer information as one record, and the Seller information in another record, each for the same data entry.

so we end up with:

<br />
BuyerorSellerInfoID (primary key) | MortgageID | BuyerID | SellerID <Br><br />
       1                             |   10       |   1     |    NULL<br><br />
       2                             |   10        |   NULL   |    2<br />


So now with my question - how can I create a stored procedure that will produce results in the same row. I am getting duplicates for each row (which I know the way it is setup I would). But is there a way in my Stored Procedure to have the output look like:

<br />
BuyerorSellerInfoID (primary key) | MortgageID | BuyerID | SellerID<br><br />
        1                            |    10      |     1   |      2<br />




Hope this made sense, question me if it does not. The formatting on my code tags didn't go so well the "|" is seperator for columns.

The database is SQL 2000 as well.

Thanks.
modified on Friday, March 12, 2010 4:02 PM

AnswerRe: Getting SP results from a table with multiple rows for same ID Pin
Luc Pattyn12-Mar-10 10:06
sitebuilderLuc Pattyn12-Mar-10 10:06 
GeneralRe: Getting SP results from a table with multiple rows for same ID Pin
DeepToot12-Mar-10 10:15
DeepToot12-Mar-10 10:15 
AnswerRe: Getting SP results from a table with multiple rows for same ID Pin
riced12-Mar-10 13:49
riced12-Mar-10 13:49 
GeneralRe: Getting SP results from a table with multiple rows for same ID Pin
DeepToot15-Mar-10 5:06
DeepToot15-Mar-10 5:06 
Questionhelp me understanding left join Pin
Mogamboo_Khush_Hua11-Mar-10 19:28
Mogamboo_Khush_Hua11-Mar-10 19:28 
AnswerRe: help me understanding left join Pin
Rod Kemp11-Mar-10 22:39
Rod Kemp11-Mar-10 22:39 
AnswerRe: help me understanding left join Pin
Mycroft Holmes11-Mar-10 23:15
professionalMycroft Holmes11-Mar-10 23:15 
GeneralRe: help me understanding left join Pin
Mogamboo_Khush_Hua12-Mar-10 2:16
Mogamboo_Khush_Hua12-Mar-10 2:16 
QuestionAccess 2007 - tabbed forms manage own popups Pin
john john mackey11-Mar-10 5:33
john john mackey11-Mar-10 5:33 
AnswerRe: Access 2007 - tabbed forms manage own popups Pin
Eddy Vluggen12-Mar-10 2:23
professionalEddy Vluggen12-Mar-10 2:23 
GeneralRe: Access 2007 - tabbed forms manage own popups Pin
john john mackey16-Mar-10 7:37
john john mackey16-Mar-10 7:37 
Questionproject Pin
salemmohamed10-Mar-10 22:54
salemmohamed10-Mar-10 22:54 
AnswerRe: project Pin
Mycroft Holmes10-Mar-10 23:53
professionalMycroft Holmes10-Mar-10 23:53 
AnswerRe: project Pin
R. Giskard Reventlov11-Mar-10 0:01
R. Giskard Reventlov11-Mar-10 0:01 
GeneralRe: project Pin
Mycroft Holmes11-Mar-10 19:07
professionalMycroft Holmes11-Mar-10 19:07 
GeneralRe: project Pin
Rob Graham14-Mar-10 6:32
Rob Graham14-Mar-10 6:32 
GeneralRe: project Pin
Mycroft Holmes14-Mar-10 14:50
professionalMycroft Holmes14-Mar-10 14:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.