Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
CSK
Constraint Violating Yak Guru
489 Posts |
Posted - 2006-09-02 : 08:36:10
|
Dear ALL,I Have The Following Columns In a table This Earning And Deductions Elements are FixedEmployee Earning Element Deduction Element000002 Production Incentive Vehicle Loan Repayment000002 Monthly Perform Allowance Salary Advance000002 Medical Monthly Proffessional Tax000002 Leave Travel Allowance Personal Loan Repayment000002 Increment Arrear Miscellaneous Deduction000002 House Rent Allowance Income Tax000002 Conveyance Employees Contri PF000002 Basic Salary Canteen Deduction000003 Production Incentive Vehicle Loan Repayment000003 Monthly Perform Allowance Salary Advance000003 Medical Monthly Proffessional Tax000003 Leave Travel Allowance Personal Loan Repayment000003 Increment Arrear Miscellaneous Deduction000003 House Rent Allowance Income Tax000003 Conveyance Employees Contri PF000003 Basic Salary Canteen DeductionBut I need the Output In following order.Employee Earning Element Deduction Element000002 Basic Salary Employees Contri PF000002 House Rent Allowance Proffessional Tax000002 Conveyance Canteen Deduction000002 Monthly Perform Allowance Income Tax000002 Medical Monthly Vehicle Loan Repayment000002 Leave Travel Allowance Salary Advance000002 Increment Arrear Miscellaneous Deduction000002 Production Incentive Personal Loan Repayment000003 Basic Salary Employees Contri PF000003 House Rent Allowance Proffessional Tax000003 Conveyance Canteen Deduction000003 Monthly Perform Allowance Income Tax000003 Medical Monthly Vehicle Loan Repayment000003 Leave Travel Allowance Salary Advance000003 Increment Arrear Miscellaneous Deduction000003 Production Incentive Personal Loan RepaymentHow Can I do The Same Thanks and RegardsKrishnakumar.C |
|
tishri
Yak Posting Veteran
95 Posts |
Posted - 2006-09-02 : 08:48:49
|
select * from table1 order by Employee,Earning ascTCC |
 |
|
CSK
Constraint Violating Yak Guru
489 Posts |
Posted - 2006-09-02 : 08:52:36
|
please look on the order it's not a perfect ascending order |
 |
|
CSK
Constraint Violating Yak Guru
489 Posts |
Posted - 2006-09-02 : 08:52:51
|
Thanks !! please look on the order it's not a perfect ascending order |
 |
|
tishri
Yak Posting Veteran
95 Posts |
Posted - 2006-09-02 : 09:01:57
|
w/c column that is not to be sorted in ascending order? you can also do this type of queryselect * from table1 order by Employee,Earning asc, Deduction descTCC |
 |
|
CSK
Constraint Violating Yak Guru
489 Posts |
Posted - 2006-09-02 : 09:05:42
|
it's some what nearest but not exact....! |
 |
|
tishri
Yak Posting Veteran
95 Posts |
Posted - 2006-09-02 : 09:13:37
|
the only sorted column in your example is the [Employee] column. i think you need to have a separate table for the columns,... Earning Element Deduction Elementthen join them using a keyTCCTCC |
 |
|
CSK
Constraint Violating Yak Guru
489 Posts |
Posted - 2006-09-02 : 09:23:05
|
Okay!! Thanks |
 |
|
|
|
|