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

Database

 
Questionsql query Pin
kadkir5-Jan-09 17:01
kadkir5-Jan-09 17:01 
AnswerRe: sql query Pin
Garth J Lancaster5-Jan-09 17:32
professionalGarth J Lancaster5-Jan-09 17:32 
GeneralRe: sql query Pin
kadkir5-Jan-09 18:03
kadkir5-Jan-09 18:03 
AnswerRe: sql query Pin
Wendelius5-Jan-09 21:56
mentorWendelius5-Jan-09 21:56 
GeneralRe: sql query Pin
kadkir5-Jan-09 23:07
kadkir5-Jan-09 23:07 
GeneralRe: sql query Pin
Wendelius5-Jan-09 23:26
mentorWendelius5-Jan-09 23:26 
GeneralRe: sql query Pin
kadkir6-Jan-09 21:23
kadkir6-Jan-09 21:23 
GeneralRe: sql query Pin
Wendelius7-Jan-09 0:45
mentorWendelius7-Jan-09 0:45 
So if your data was:
Row | IssuedBankId | paidBankId | Payable | Receivable
1   | 1            | 2          | 1000    | 2000
2   | 1            | 3          | 1100    | 3000
3   | 1            | 4          | 4000    | 5000
4   | 2            | 1          | 2000    | 1000
5   | 3            | 1          | 3000    | 1100
6   | 4            | 2          | 5000    | Null
7   | 5            | 4          | 1000    | Null 

and you said that if the user select 1 for bankid, then you would like the result to be:
Row | IssuedBankId | paidBankId | Payable | Receivable
1   | 1            | 2          | 1000    | 2000
2   | 1            | 3          | 1100    | 3000
3   | 1            | 4          | 4000    | 5000

Is that correct? Are all the rows and columns present? Since that would be simply:
SELECT *
FROM   TableName
WHERE  IssuedBankId = 1

I suppose that this isn't what you're looking for?

The need to optimize rises from a bad design.My articles[^]

GeneralRe: sql query Pin
kadkir7-Jan-09 19:17
kadkir7-Jan-09 19:17 
GeneralRe: sql query Pin
Wendelius7-Jan-09 19:41
mentorWendelius7-Jan-09 19:41 
QuestionImport Data From Other Database and Eliminate Duplicates Pin
polishprogrammer5-Jan-09 9:59
polishprogrammer5-Jan-09 9:59 
AnswerRe: Import Data From Other Database and Eliminate Duplicates Pin
Wendelius5-Jan-09 10:25
mentorWendelius5-Jan-09 10:25 
GeneralRe: Import Data From Other Database and Eliminate Duplicates Pin
polishprogrammer5-Jan-09 10:38
polishprogrammer5-Jan-09 10:38 
GeneralRe: Import Data From Other Database and Eliminate Duplicates Pin
Wendelius5-Jan-09 10:58
mentorWendelius5-Jan-09 10:58 
GeneralRe: Import Data From Other Database and Eliminate Duplicates Pin
polishprogrammer7-Jan-09 9:47
polishprogrammer7-Jan-09 9:47 
GeneralRe: Import Data From Other Database and Eliminate Duplicates Pin
Wendelius7-Jan-09 10:00
mentorWendelius7-Jan-09 10:00 
GeneralRe: Import Data From Other Database and Eliminate Duplicates Pin
polishprogrammer8-Jan-09 10:56
polishprogrammer8-Jan-09 10:56 
GeneralRe: Import Data From Other Database and Eliminate Duplicates Pin
Wendelius8-Jan-09 11:06
mentorWendelius8-Jan-09 11:06 
QuestionSQL Server- Upload CSV file via Bulk Insert with double Quotation Issue? Pin
Tarini Singh5-Jan-09 4:21
Tarini Singh5-Jan-09 4:21 
AnswerRe: SQL Server- Upload CSV file via Bulk Insert with double Quotation Issue? Pin
Wendelius5-Jan-09 9:18
mentorWendelius5-Jan-09 9:18 
QuestionProblem with large database fetching Pin
Member 40015965-Jan-09 2:40
Member 40015965-Jan-09 2:40 
AnswerRe: Problem with large database fetching Pin
Ashfield5-Jan-09 2:54
Ashfield5-Jan-09 2:54 
AnswerRe: Problem with large database fetching Pin
Wendelius5-Jan-09 9:22
mentorWendelius5-Jan-09 9:22 
AnswerRe: Problem with large database fetching Pin
Aman Bhullar6-Jan-09 5:45
Aman Bhullar6-Jan-09 5:45 
GeneralRe: Problem with large database fetching Pin
Member 40015966-Jan-09 20:22
Member 40015966-Jan-09 20:22 

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.