Click here to Skip to main content
15,884,298 members
Articles / Programming Languages / SQL

SQL query result not as expected

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
27 Dec 2012CPOL 3.1K  
i have 12 record. i want to show Amount,date and installment no 12 times in a sequence but loan id only one time in a row. help me with this. thanX in advanceSelect c.Loan_id,i.Installment_no,i.Date,i.Amount from Customer c,Installments i,Loan l where l.Loan_id=c.Loan_id and...

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
27 Dec 2012snorkie
zeshanazam,Ideally, you would just limit the output in the code. But if you have to only have it output on one row, try the following. I'm assuming you're using SQL Server. Different database may change the syntax.Select CASE i.Installment_no WHEN 1 THEN c.Loan_id ELSE...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Unknown
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions