Hello guys I would like to ask you about how to select in sql server.
I have a table:
CREATE TABLE [dbo].[tblTxnDecreaseAmnt](
[AccountID] [int] NULL,
[TxnAmount] [nvarchar](50) NULL,
[TxnDate] [datetime] NULL
) ON [PRIMARY]
GO
INSERT [dbo].[tblTxnDecreaseAmnt] ([AccountID], [TxnAmount], [TxnDate]) VALUES (11, N'200', CAST(0x0000A64B00735B40 AS DateTime))
INSERT [dbo].[tblTxnDecreaseAmnt] ([AccountID], [TxnAmount], [TxnDate]) VALUES (11, N'15', CAST(0x0000A64B008C1360 AS DateTime))
INSERT [dbo].[tblTxnDecreaseAmnt] ([AccountID], [TxnAmount], [TxnDate]) VALUES (11, N'10', CAST(0x0000A64B008CA000 AS DateTime))
INSERT [dbo].[tblTxnDecreaseAmnt] ([AccountID], [TxnAmount], [TxnDate]) VALUES (11, N'10', CAST(0x0000A64B008CA000 AS DateTime))
INSERT [dbo].[tblTxnDecreaseAmnt] ([AccountID], [TxnAmount], [TxnDate]) VALUES (12, N'5000', CAST(0x0000A64B008CA000 AS DateTime))
INSERT [dbo].[tblTxnDecreaseAmnt] ([AccountID], [TxnAmount], [TxnDate]) VALUES (12, N'5000', CAST(0x0000A64B008CA000 AS DateTime))
INSERT [dbo].[tblTxnDecreaseAmnt] ([AccountID], [TxnAmount], [TxnDate]) VALUES (12, N'3000', CAST(0x0000A64B008ED280 AS DateTime))
INSERT [dbo].[tblTxnDecreaseAmnt] ([AccountID], [TxnAmount], [TxnDate]) VALUES (13, N'300', CAST(0x0000A64B009F4D40 AS DateTime))
INSERT [dbo].[tblTxnDecreaseAmnt] ([AccountID], [TxnAmount], [TxnDate]) VALUES (13, N'350', CAST(0x0000A64B00AFC800 AS DateTime))
INSERT [dbo].[tblTxnDecreaseAmnt] ([AccountID], [TxnAmount], [TxnDate]) VALUES (13, N'12', CAST(0x0000A64B00C042C0 AS DateTime))
INSERT [dbo].[tblTxnDecreaseAmnt] ([AccountID], [TxnAmount], [TxnDate]) VALUES (14, N'50', CAST(0x0000A64B00C5C100 AS DateTime))
INSERT [dbo].[tblTxnDecreaseAmnt] ([AccountID], [TxnAmount], [TxnDate]) VALUES (14, N'20', CAST(0x0000A64B00CDFE60 AS DateTime))
.I want to select AccountID who do txn >=3 times in a day and TxnAmount Decrease from one transaction to another transaction.
.The result I want is :
Please kindly help me, Thanks for in advance. And sorry my english is not very well.
select * from tblTxnDecreaseAmnt