Click here to Skip to main content
15,903,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
CSS
2110060101092684    1500    2009    23/06/2010 12:00:00 AM  Tr from Rebate  96.0000 NULL    1   1   Pacs    Direct  NULL    17768   Transfer    147059  NULL    1092    96.0000 NULL    NULL    NULL    NULL    00031
2110060101092684    1500    2009    21/08/2010 12:00:00 AM  Transfer    NULL    450.0000    2   3   Pacs    Direct  20/08/2011 12:00:00 AM  17911   Transfer    99  NULL    1092    NULL    NULL    NULL    NULL    NULL    00031
2110060101092684    1500    2009    26/03/2011 12:00:00 AM  Cash    21914.0000  NULL    2   3   Pacs    Direct  NULL    19055   Cash    521849  125.0000    1092    20354.0000  1426.0000   9.0000  0.0000  NULL    00031
2110060101092684    1500    2009    30/03/2011 12:00:00 AM  Transfer    NULL    35000.0000  2   3   Pacs    Direct  29/03/2012 12:00:00 AM  19263   Transfer    64  NULL    1092    NULL    NULL    NULL    NULL    NULL    00031



I need to after withdrawal amount TransactionDate Transactions
How to write the query
Posted
Updated 6-Sep-11 2:11am
v3

1 solution

One way to do this is something like (if transactiondate defines uniquely the order):
SQL
select *
from tablename tn
where 1 = (select count(*)
           from tablename tn2
           where tn2.transactionadate < tn.transactiondate)

That should select the row having the second lowest transaction date.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900