Viewing 14 posts - 16 through 29 (of 29 total)
DECLARE @Tbl_AccountTABLE(
AccNoint,
Add_By_AccNoint,
Commdecimal(18,8),
lvl nvarchar(50))
INSERT @Tbl_Account VALUES(2,0,6,'MANAGER'),(3,2,4,'AGENT'),(5,3,3,'SALE PERSON'),(6,2,4,'AGENT')
DECLARE @Tbl_Transaction TABLE(
Transaction_AccNoint,
Commdecimal(18,8),
Amountdecimal(18,8))
DECLARE @PurchasePrice decimal(18,3)
set @PurchasePrice = 10.00;
WITH Dependencies AS(
SELECT * FROM @Tbl_Account WHERE AccNo = 5 UNION ALL
SELECT t.* FROM @Tbl_Account t
JOIN...
August 31, 2012 at 11:26 am
Tbl_Account
AccNo Commision Add_By_AccNo Level
2 6.000 0 MANAGER
3 4.000 2 SUPERVISOR
5 3.000 3 SALEPERSON
Tbl_Transaction //this is the example insert query success
AccNo Commision Amount
5 1% $0.10
3 2% $0.20
2 2% $0.20
This is the...
August 31, 2012 at 11:17 am
Msg 319, Level 15, State 1, Line 13
Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause,...
August 31, 2012 at 11:14 am
Sean Lange (8/31/2012)
chinye2020 (8/31/2012)
AccNo Comm Add_By_AccNo Level
2 6.000 0 MANAGER
3 4.000 2 SUPERVISOR
5 3.000 3 SALEPERSON
Tbl_Transaction //this is the example insert query success
Transaction_AccNo Comm Amount
5 1% $0.10
3 2% $0.20
2 2%...
August 31, 2012 at 11:02 am
Tbl_Account
AccNo Comm Add_By_AccNo Level
2 6.000 0 MANAGER
3 4.000 2 SUPERVISOR
5 3.000 3 SALEPERSON
Tbl_Transaction //this is the example insert query success
Transaction_AccNo Comm Amount
5 1% $0.10
3 2% $0.20
2 2% $0.20 //how to...
August 31, 2012 at 10:53 am
Luis Cazares (8/31/2012)
You should pay more attention to your code to...
August 31, 2012 at 10:05 am
how to in select query save the last row Commision Value?have any idea?
August 31, 2012 at 9:36 am
Tbl_Account
AccNo Commision Add_By_AccNo Level
2 6.000 0 MANAGER
3 4.0002 SUPERVISOR
5 3.0003 SALEPERSON
Tbl_Transaction //this is the example insert query success
AccNo Commision Amount
5 1% $0.10
3 2% $0.20
2 2% $0.20
This is the Database with...
August 31, 2012 at 9:34 am
im using CTE read the most lowest member until top,
but until top,need to read back the second top Commision,this is the problem
August 31, 2012 at 8:40 am
AccNo Commision Add_By_AccNo
2 6.000 0
3 4.0002
5 3.0003
WITH Dependencies AS(SELECT * FROM Tbl_Account WHERE AccNo = 5 UNION ALL SELECT t.* FROM Tbl_Account t JOIN Dependencies d ON t.AccNo = d.Add_By_AccNo)
INSERT...
August 31, 2012 at 8:27 am
problem solved,should be like this
-- Insert statements for procedure here
WITH Dependencies AS(SELECT * FROM Tbl_Account WHERE AccNo = 8 UNION ALL SELECT t.* FROM Tbl_Account t...
August 31, 2012 at 4:04 am
USE [DB_Flexi]
GO
/****** Object: StoredProcedure [dbo].[UpdateUserAmount] Script Date: 08/30/2012 14:48:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[UpdateUserAmount]
@Topup_Amount decimal(18,2),
@AccNo int
--@Balance INT OUTPUT
AS
BEGIN
--...
August 31, 2012 at 4:00 am
Luis Cazares (8/30/2012)
It shouldn't be difficult and you must understand it before you use it.Read about Recursive CTEs.
If you have a specific question, don't hesitate to ask it.
thanks.understood~
August 30, 2012 at 2:09 pm
Great job man ! that's what i want....
that's damn difficult....
August 30, 2012 at 11:36 am
Viewing 14 posts - 16 through 29 (of 29 total)