SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Need Urgent Help on this Query
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

amit120k
Starting Member

India
14 Posts

Posted - 01/10/2013 :  01:51:02  Show Profile  Reply with Quote
My result set return me following result set:

Question User_Answer Right_Answer Status
-------- --------- ------------ -------
FT stands for? NULL NULL Wrong
FT stands for? NULL NULL Wrong
FT stands for? Fund Transfer Fund Transfer Right
FT stands for? NULL NULL Wrong
When you can perform the operation? NULL NULL WRONG
When you can perform the operation? Evening Time NULL WRONG
When you can perform the operation? NULL Morning WRONG
When you can perform the operation? NULL NULL WRONG
FT stands for? NULL NULL Wrong
FT stands for? NULL NULL Wrong
FT stands for? Fund Transfer Fund Transfer Right
FT stands for? NULL NULL Wrong
When you can perform the operation? NULL NULL WRONG
When you can perform the operation? Evening Time NULL WRONG
When you can perform the operation? NULL Morning WRONG
When you can perform the operation? NULL NULL WRONG

It should be displayed like this:

Question Attempts User_Answer Right_Answer Status
-------- --------- ----------- ------------ -------
FT stands for? 1 Fund Transfer Fund Transfer Right
When you can perform the operation? 1 Evening Time Morning WRONG
FT stands for? 2 Fund Transfer Fund Transfer Right
When you can perform the operation? 2 Evening Time Morning WRONG

bandi
Flowing Fount of Yak Knowledge

India
2217 Posts

Posted - 01/10/2013 :  02:53:05  Show Profile  Reply with Quote
SELECT *, row_number() OVER(Partition by Question ORDER BY [status]) Attempts
FROM (SELECT * FROM @tab WHERE User_Answer IS NOT NULL) p

here @tab is your table name

--
Chandu
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 01/10/2013 :  03:27:17  Show Profile  Reply with Quote
what if there are more rows with different non NULL values for User_Answer field for same Question?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

amit120k
Starting Member

India
14 Posts

Posted - 01/10/2013 :  04:48:56  Show Profile  Reply with Quote
The solution is not working if few column are added.
The original result set i have is:

TEST ID MODULE NAME TEST NAME QUESTION USER ANSWER RIGHT ANSWER STATUS
00009 Sub Process Map Anti Money Laundring As per requirement in inward clearing zone in HICTMO the user can. All above WRONG
00009 Sub Process Map Anti Money Laundring As per requirement in inward clearing zone in HICTMO the user can. Modify WRONG
00009 Sub Process Map Anti Money Laundring Before entering cheques in inward clearing zone the status of zone should be. Copy Zone WRONG
00009 Sub Process Map Anti Money Laundring Before entering cheques in inward clearing zone the status of zone should be. Open Zone WRONG
00009 Sub Process Map Anti Money Laundring Carved amount in customer's account will appear in account balance details in. None of Above WRONG
00009 Sub Process Map Anti Money Laundring Carved amount in customer's account will appear in account balance details in. System Reserved Amount System Reserved Amount RIGHT
00009 Sub Process Map Anti Money Laundring For entering total count and amount of instruments in inward clearing zone user has to select menu shortcut ⬠Function. HMCLZOH - ENTER WRONG
00009 Sub Process Map Anti Money Laundring For entering total count and amount of instruments in inward clearing zone user has to select menu shortcut ⬠Function. HMICZ - MODIFY WRONG
00009 Sub Process Map Anti Money Laundring Menu short cut for generating and printing of rejected instrument report in inward clearing zone is. HREJPT WRONG
00009 Sub Process Map Anti Money Laundring Menu short cut for generating and printing of rejected instrument report in inward clearing zone is. HREJREP WRONG
00009 Sub Process Map Anti Money Laundring Menu short cut for printing validation run report for inward clearing is. HPR WRONG
00009 Sub Process Map Anti Money Laundring Menu short cut for printing validation run report for inward clearing is. HPRINT WRONG
00009 Sub Process Map Anti Money Laundring Menu shortcut & option for entering instruments in inward clearing zone is. HICTM - ADD WRONG
00009 Sub Process Map Anti Money Laundring Menu shortcut & option for entering instruments in inward clearing zone is. HICTMO - ADD WRONG
00009 Sub Process Map Anti Money Laundring Menu shortcut to maintain inward clearing zone is. HMCLZOH WRONG
00009 Sub Process Map Anti Money Laundring Menu shortcut to maintain inward clearing zone is. HMICZ WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account FT stands for? Fund Transfer Fund Transfer RIGHT
0000A Fund Transfer(NEFT) Fund Transfer To Account In a day How many time you can do a Fund Transfer? Many Many RIGHT
0000A Fund Transfer(NEFT) Fund Transfer To Account What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 5 WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 50 WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account When you can perform the operation? All Day WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account When you can perform the operation? Morning Hours WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account FT stands for? Fund Transfer Fund Transfer RIGHT
0000A Fund Transfer(NEFT) Fund Transfer To Account In a day How many time you can do a Fund Transfer? Many Many RIGHT
0000A Fund Transfer(NEFT) Fund Transfer To Account What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 100 WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 50 Rs 50 RIGHT
0000A Fund Transfer(NEFT) Fund Transfer To Account When you can perform the operation? Morning Hours Morning Hours RIGHT
0000A Fund Transfer(NEFT) Fund Transfer To Account When you can perform the operation? Night Hours WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account FT stands for? Fund Transfer Fund Transfer RIGHT
0000A Fund Transfer(NEFT) Fund Transfer To Account In a day How many time you can do a Fund Transfer? 10 WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account In a day How many time you can do a Fund Transfer? Many WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 5 WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 50 WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account When you can perform the operation? Evening Time WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account When you can perform the operation? Morning Hours WRONG
0000B Accounts Credit Card FT stands for? Find Transfer WRONG
0000B Accounts Credit Card FT stands for? Fund Transfer WRONG
0000B Accounts Credit Card In a day How many time you can do a Fund Transfer? 2 WRONG
0000B Accounts Credit Card In a day How many time you can do a Fund Transfer? Many WRONG
0000B Accounts Credit Card What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 10 WRONG
0000B Accounts Credit Card What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 50 WRONG
0000B Accounts Credit Card When you can perform the operation? All Day WRONG
0000B Accounts Credit Card When you can perform the operation? Morning Hours Morning Hours RIGHT
0000B Accounts Credit Card FT stands for? Fund Transfer Fund Transfer RIGHT
0000B Accounts Credit Card In a day How many time you can do a Fund Transfer? Many Many RIGHT
0000B Accounts Credit Card What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 5 WRONG
0000B Accounts Credit Card What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 50 WRONG
0000B Accounts Credit Card When you can perform the operation? All Day WRONG
0000B Accounts Credit Card When you can perform the operation? Evening Time WRONG
0000B Accounts Credit Card When you can perform the operation? Morning Hours WRONG
0000B Accounts Credit Card FT stands for? Find Transfer WRONG
0000B Accounts Credit Card FT stands for? Fund Transfer WRONG
0000B Accounts Credit Card In a day How many time you can do a Fund Transfer? 10 WRONG
0000B Accounts Credit Card In a day How many time you can do a Fund Transfer? Many WRONG
0000B Accounts Credit Card What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 50 Rs 50 RIGHT
0000B Accounts Credit Card When you can perform the operation? Morning Hours WRONG
0000B Accounts Credit Card When you can perform the operation? Night Hours WRONG


It should display with the Attempts means
Attempts should be evaluated based upon Number of times Test taken..
and there should be one Question,User Answer,Right answer and status in a single row.

Go to Top of Page

bandi
Flowing Fount of Yak Knowledge

India
2217 Posts

Posted - 01/10/2013 :  05:55:14  Show Profile  Reply with Quote
once execute this....
This is for calculating number of attempts per question in a test

DECLARE @tab TABLE(TESTID varchar(10), MODULENAME  varchar(100),TESTNAME  varchar(100), QUESTION   varchar(100), USERANSWER  varchar(100), RIGHTANSWER  varchar(100), STATUS   varchar(100))
INSERT INTO @tab 
SELECT '0000A', 'Fund Transfer(NEFT)', 'Fund Transfer To Account', 'FT stands for?', 'Fund Transfer', 'Fund Transfer', 'RIGHT' union all
SELECT '0000A', 'Fund Transfer(NEFT)', 'Fund Transfer To Account', 'In a day How many time you can do a Fund Transfer?', 'Many', 'Many', 'RIGHT' union all
SELECT '0000A', 'Fund Transfer(NEFT)', 'Fund Transfer To Account', 'What are the charges for doing a Fun transfer of 10,000 Rs.?', null, 'Rs 5', 'WRONG' union all
SELECT '0000A', 'Fund Transfer(NEFT)', 'Fund Transfer To Account', 'What are the charges for doing a Fun transfer of 10,000 Rs.?', null, 'Rs 50', 'WRONG' union all
SELECT '0000A', 'Fund Transfer(NEFT)', 'Fund Transfer To Account', 'When you can perform the operation?', null, 'All Day', 'WRONG' union all
SELECT '0000A', 'Fund Transfer(NEFT)', 'Fund Transfer To Account', 'When you can perform the operation?', null, 'Morning Hours', 'WRONG' union all
SELECT '0000A', 'Fund Transfer(NEFT)', 'Fund Transfer To Account', 'FT stands for?', 'Fund Transfer', 'Fund Transfer', 'RIGHT' union all
SELECT '0000A', 'Fund Transfer(NEFT)', 'Fund Transfer To Account', 'In a day How many time you can do a Fund Transfer?', 'Many', 'Many', 'RIGHT' union all
SELECT '0000A', 'Fund Transfer(NEFT)', 'Fund Transfer To Account', 'What are the charges for doing a Fun transfer of 10,000 Rs.?', null, 'Rs 100', 'WRONG' union all
SELECT '0000A', 'Fund Transfer(NEFT)', 'Fund Transfer To Account', 'What are the charges for doing a Fun transfer of 10,000 Rs.?', 'Rs 50', 'Rs 50', 'RIGHT' union all
SELECT '0000A', 'Fund Transfer(NEFT)', 'Fund Transfer To Account', 'When you can perform the operation?', 'Morning Hours', 'Morning Hours', 'RIGHT' union all
SELECT '0000A', 'Fund Transfer(NEFT)', 'Fund Transfer To Account', 'When you can perform the operation?', null,  'Night Hours', 'WRONG' union all
SELECT '0000A', 'Fund Transfer(NEFT)', 'Fund Transfer To Account', 'FT stands for?', 'Fund Transfer', 'Fund Transfer', 'RIGHT' union all
SELECT '0000A', 'Fund Transfer(NEFT)', 'Fund Transfer To Account', 'In a day How many time you can do a Fund Transfer?', null, '10', 'WRONG' union all
SELECT '0000A', 'Fund Transfer(NEFT)', 'Fund Transfer To Account', 'In a day How many time you can do a Fund Transfer?',null, 'Many', 'WRONG' union all
SELECT '0000A', 'Fund Transfer(NEFT)', 'Fund Transfer To Account', 'What are the charges for doing a Fun transfer of 10,000 Rs.?', null, 'Rs 5', 'WRONG' union all
SELECT '0000A', 'Fund Transfer(NEFT)', 'Fund Transfer To Account', 'What are the charges for doing a Fun transfer of 10,000 Rs.?', null, 'Rs 50', 'WRONG' union all
SELECT '0000A', 'Fund Transfer(NEFT)', 'Fund Transfer To Account', 'When you can perform the operation?', null, 'Evening Time', 'WRONG' union all
SELECT '0000A', 'Fund Transfer(NEFT)', 'Fund Transfer To Account', ' When you can perform the operation?', null, 'Morning Hours', 'WRONG' union all
SELECT '0000B', 'Accounts', 'Credit Card', 'FT stands for?', null, 'Find Transfer', 'WRONG' union all
SELECT '0000B', 'Accounts', 'Credit Card', 'FT stands for?', 'Fund Transfer', null, 'WRONG' union all
SELECT '0000B', 'Accounts', 'Credit Card', 'In a day How many time you can do a Fund Transfer?', null, '2', 'WRONG' union all
SELECT '0000B', 'Accounts', 'Credit Card', 'In a day How many time you can do a Fund Transfer?', null, 'Many', 'WRONG' union all
SELECT '0000B', 'Accounts', 'Credit Card', 'What are the charges for doing a Fun transfer of 10,000 Rs.?', null, 'Rs 10', 'WRONG' union all
SELECT '0000B', 'Accounts', 'Credit Card', 'What are the charges for doing a Fun transfer of 10,000 Rs.?', null, 'Rs 50', ' WRONG' union all
SELECT '0000B', 'Accounts', 'Credit Card', 'When you can perform the operation?', null, 'All Day', 'WRONG' union all
SELECT '0000B', 'Accounts', 'Credit Card', 'When you can perform the operation?', 'Morning Hours', 'Morning Hours', 'RIGHT' union all
SELECT '0000B', 'Accounts', 'Credit Card', 'FT stands for?', 'Fund Transfer', 'Fund Transfer', 'RIGHT' union all
SELECT '0000B', 'Accounts', 'Credit Card', 'In a day How many time you can do a Fund Transfer?', 'Many', 'Many', 'RIGHT' union all
SELECT '0000B', 'Accounts', 'Credit Card', 'What are the charges for doing a Fun transfer of 10,000 Rs.?', null, 'Rs 5', 'WRONG' union all
SELECT '0000B', 'Accounts', 'Credit Card', 'What are the charges for doing a Fun transfer of 10,000 Rs.?', null, 'Rs 50', 'WRONG' union all
SELECT '0000B', 'Accounts', 'Credit Card', 'When you can perform the operation?', null, 'All Day', 'WRONG' union all
SELECT '0000B', 'Accounts', 'Credit Card', 'When you can perform the operation?', NULL, 'Evening Time', 'WRONG' union all
SELECT '0000B', 'Accounts', 'Credit Card', 'When you can perform the operation?', NULL,'Morning Hours', 'WRONG' union all
SELECT '0000B', 'Accounts', 'Credit Card', 'FT stands for?', NULL,  'Find Transfer', 'WRONG' union all
SELECT '0000B', 'Accounts', 'Credit Card', 'FT stands for?', NULL, 'Fund Transfer', 'WRONG' union all
SELECT '0000B', 'Accounts', 'Credit Card', 'In a day How many time you can do a Fund Transfer?', null, '10', 'WRONG' union all
SELECT '0000B', 'Accounts', 'Credit Card', 'In a day How many time you can do a Fund Transfer?', null,  'Many', 'WRONG' union all
SELECT '0000B', 'Accounts', 'Credit Card', 'What are the charges for doing a Fun transfer of 10,000 Rs.?', 'Rs 50', 'Rs 50', 'RIGHT' union all
SELECT '0000B', 'Accounts', 'Credit Card', 'When you can perform the operation?', NULL, 'Morning Hours', 'WRONG' union all
SELECT '0000B', 'Accounts', 'Credit Card', 'When you can perform the operation?', NULL, 'Night Hours', 'WRONG'
/*
It should display with the Attempts means 
Attempts should be evaluated based upon Number of times Test taken..
and there should be one Question,User Answer,Right answer and status in a single row.
STATUS
*/
;with cte 
as
( SELECT TESTID, MODULENAME, TESTNAME , QUESTION, 
	ROW_NUMBER() OVER(PARTITION BY TESTID, MODULENAME, TESTNAME , QUESTION ORDER BY (SELECT 1)) attempts,
	USERANSWER, RIGHTANSWER, STATUS
	FROM @tab
)
SELECT TESTID, MODULENAME, TESTNAME , QUESTION, MIN(attempts) attmpts, MAX(UserAnswer) UAns,MAX(Rightanswer) rAns, MAX(status) stus
FROM cte
WHERE status = 'right'
GROUP BY TESTID, MODULENAME, TESTNAME , QUESTION
ORDER BY TESTID, MODULENAME, TESTNAME , QUESTION



TESTID	MODULENAME			TESTNAME					QUESTION			attmpts	UAns		rAns			stus
0000A	Fund Transfer(NEFT)	Fund Transfer To Account	FT stands for?						1	Fund Transfer	Fund Transfer	RIGHT
0000A	Fund Transfer(NEFT)	Fund Transfer To Account	In a day How many time you can do a Fund Transfer?	3	Many			Many	RIGHT
0000A	Fund Transfer(NEFT)	Fund Transfer To Account	What are the charges for doing atransfer of 10,000 Rs.?	4	Rs 50			Rs 50	RIGHT
0000A	Fund Transfer(NEFT)	Fund Transfer To Account	When you can perform the operation?			2	Morning Hours	Morning Hours	RIGHT
0000B	Accounts		Credit Card			FT stands for?						3	Fund Transfer	Fund Transfer	RIGHT
0000B	Accounts		Credit Card			In a day How many time you can do a Fund Transfer?	3	Many			Many	RIGHT
0000B	Accounts		Credit Card			What are the charges for doing a transfer of 10,000 Rs.? 5	Rs 50		Rs 50		RIGHT
0000B	Accounts		Credit Card			When you can perform the operation?			7	Morning Hours	Morning Hours	RIGHT




--
Chandu

Edited by - bandi on 01/10/2013 06:18:18
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 01/10/2013 :  06:01:19  Show Profile  Reply with Quote
quote:
Originally posted by amit120k

The solution is not working if few column are added.
The original result set i have is:

TEST ID MODULE NAME TEST NAME QUESTION USER ANSWER RIGHT ANSWER STATUS
00009 Sub Process Map Anti Money Laundring As per requirement in inward clearing zone in HICTMO the user can. All above WRONG
00009 Sub Process Map Anti Money Laundring As per requirement in inward clearing zone in HICTMO the user can. Modify WRONG
00009 Sub Process Map Anti Money Laundring Before entering cheques in inward clearing zone the status of zone should be. Copy Zone WRONG
00009 Sub Process Map Anti Money Laundring Before entering cheques in inward clearing zone the status of zone should be. Open Zone WRONG
00009 Sub Process Map Anti Money Laundring Carved amount in customer's account will appear in account balance details in. None of Above WRONG
00009 Sub Process Map Anti Money Laundring Carved amount in customer's account will appear in account balance details in. System Reserved Amount System Reserved Amount RIGHT
00009 Sub Process Map Anti Money Laundring For entering total count and amount of instruments in inward clearing zone user has to select menu shortcut ⬠Function. HMCLZOH - ENTER WRONG
00009 Sub Process Map Anti Money Laundring For entering total count and amount of instruments in inward clearing zone user has to select menu shortcut ⬠Function. HMICZ - MODIFY WRONG
00009 Sub Process Map Anti Money Laundring Menu short cut for generating and printing of rejected instrument report in inward clearing zone is. HREJPT WRONG
00009 Sub Process Map Anti Money Laundring Menu short cut for generating and printing of rejected instrument report in inward clearing zone is. HREJREP WRONG
00009 Sub Process Map Anti Money Laundring Menu short cut for printing validation run report for inward clearing is. HPR WRONG
00009 Sub Process Map Anti Money Laundring Menu short cut for printing validation run report for inward clearing is. HPRINT WRONG
00009 Sub Process Map Anti Money Laundring Menu shortcut & option for entering instruments in inward clearing zone is. HICTM - ADD WRONG
00009 Sub Process Map Anti Money Laundring Menu shortcut & option for entering instruments in inward clearing zone is. HICTMO - ADD WRONG
00009 Sub Process Map Anti Money Laundring Menu shortcut to maintain inward clearing zone is. HMCLZOH WRONG
00009 Sub Process Map Anti Money Laundring Menu shortcut to maintain inward clearing zone is. HMICZ WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account FT stands for? Fund Transfer Fund Transfer RIGHT
0000A Fund Transfer(NEFT) Fund Transfer To Account In a day How many time you can do a Fund Transfer? Many Many RIGHT
0000A Fund Transfer(NEFT) Fund Transfer To Account What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 5 WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 50 WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account When you can perform the operation? All Day WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account When you can perform the operation? Morning Hours WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account FT stands for? Fund Transfer Fund Transfer RIGHT
0000A Fund Transfer(NEFT) Fund Transfer To Account In a day How many time you can do a Fund Transfer? Many Many RIGHT
0000A Fund Transfer(NEFT) Fund Transfer To Account What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 100 WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 50 Rs 50 RIGHT
0000A Fund Transfer(NEFT) Fund Transfer To Account When you can perform the operation? Morning Hours Morning Hours RIGHT
0000A Fund Transfer(NEFT) Fund Transfer To Account When you can perform the operation? Night Hours WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account FT stands for? Fund Transfer Fund Transfer RIGHT
0000A Fund Transfer(NEFT) Fund Transfer To Account In a day How many time you can do a Fund Transfer? 10 WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account In a day How many time you can do a Fund Transfer? Many WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 5 WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 50 WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account When you can perform the operation? Evening Time WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account When you can perform the operation? Morning Hours WRONG
0000B Accounts Credit Card FT stands for? Find Transfer WRONG
0000B Accounts Credit Card FT stands for? Fund Transfer WRONG
0000B Accounts Credit Card In a day How many time you can do a Fund Transfer? 2 WRONG
0000B Accounts Credit Card In a day How many time you can do a Fund Transfer? Many WRONG
0000B Accounts Credit Card What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 10 WRONG
0000B Accounts Credit Card What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 50 WRONG
0000B Accounts Credit Card When you can perform the operation? All Day WRONG
0000B Accounts Credit Card When you can perform the operation? Morning Hours Morning Hours RIGHT
0000B Accounts Credit Card FT stands for? Fund Transfer Fund Transfer RIGHT
0000B Accounts Credit Card In a day How many time you can do a Fund Transfer? Many Many RIGHT
0000B Accounts Credit Card What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 5 WRONG
0000B Accounts Credit Card What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 50 WRONG
0000B Accounts Credit Card When you can perform the operation? All Day WRONG
0000B Accounts Credit Card When you can perform the operation? Evening Time WRONG
0000B Accounts Credit Card When you can perform the operation? Morning Hours WRONG
0000B Accounts Credit Card FT stands for? Find Transfer WRONG
0000B Accounts Credit Card FT stands for? Fund Transfer WRONG
0000B Accounts Credit Card In a day How many time you can do a Fund Transfer? 10 WRONG
0000B Accounts Credit Card In a day How many time you can do a Fund Transfer? Many WRONG
0000B Accounts Credit Card What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 50 Rs 50 RIGHT
0000B Accounts Credit Card When you can perform the operation? Morning Hours WRONG
0000B Accounts Credit Card When you can perform the operation? Night Hours WRONG


It should display with the Attempts means
Attempts should be evaluated based upon Number of times Test taken..
and there should be one Question,User Answer,Right answer and status in a single row.




whats the resultset you're expecting out of above?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

amit120k
Starting Member

India
14 Posts

Posted - 01/12/2013 :  02:29:28  Show Profile  Reply with Quote
Sorry dude that solution does not give me the desired result ..
I think i have not provided right information..what i want
Below is the result:

TEST ID MODULE NAME TEST NAME Attempts No QUESTION USER ANSWER RIGHT ANSWER STATUS
00009 Sub Process Map Anti Money Laundring 1 As per requirement in inward clearing zone in HICTMO the user can. All above WRONG
00009 Sub Process Map Anti Money Laundring 2 As per requirement in inward clearing zone in HICTMO the user can. Modify WRONG
00009 Sub Process Map Anti Money Laundring 3 Before entering cheques in inward clearing zone the status of zone should be. Open Zone WRONG
00009 Sub Process Map Anti Money Laundring 4 Before entering cheques in inward clearing zone the status of zone should be. Copy Zone WRONG
00009 Sub Process Map Anti Money Laundring 5 Carved amount in customer's account will appear in account balance details in. None of Above WRONG
00009 Sub Process Map Anti Money Laundring 6 Carved amount in customer's account will appear in account balance details in. System Reserved Amount System Reserved Amount RIGHT
00009 Sub Process Map Anti Money Laundring 7 For entering total count and amount of instruments in inward clearing zone user has to select menu shortcut ⬠Function. HMICZ - MODIFY WRONG
00009 Sub Process Map Anti Money Laundring 8 For entering total count and amount of instruments in inward clearing zone user has to select menu shortcut ⬠Function. HMCLZOH - ENTER WRONG
00009 Sub Process Map Anti Money Laundring 9 Menu short cut for generating and printing of rejected instrument report in inward clearing zone is. HREJREP WRONG
00009 Sub Process Map Anti Money Laundring 10 Menu short cut for generating and printing of rejected instrument report in inward clearing zone is. HREJPT WRONG
00009 Sub Process Map Anti Money Laundring 11 Menu short cut for printing validation run report for inward clearing is. HPR WRONG
00009 Sub Process Map Anti Money Laundring 12 Menu short cut for printing validation run report for inward clearing is. HPRINT WRONG
00009 Sub Process Map Anti Money Laundring 13 Menu shortcut & option for entering instruments in inward clearing zone is. HICTMO - ADD WRONG
00009 Sub Process Map Anti Money Laundring 14 Menu shortcut & option for entering instruments in inward clearing zone is. HICTM - ADD WRONG
00009 Sub Process Map Anti Money Laundring 15 Menu shortcut to maintain inward clearing zone is. HMICZ WRONG
00009 Sub Process Map Anti Money Laundring 16 Menu shortcut to maintain inward clearing zone is. HMCLZOH WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account 1 FT stands for? Fund Transfer Fund Transfer RIGHT
0000A Fund Transfer(NEFT) Fund Transfer To Account 2 In a day How many time you can do a Fund Transfer? Many Many RIGHT
0000A Fund Transfer(NEFT) Fund Transfer To Account 3 What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 50 WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account 4 What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 5 WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account 5 When you can perform the operation? Morning Hours WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account 6 When you can perform the operation? All Day WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account 1 FT stands for? Fund Transfer Fund Transfer RIGHT
0000A Fund Transfer(NEFT) Fund Transfer To Account 2 In a day How many time you can do a Fund Transfer? Many Many RIGHT
0000A Fund Transfer(NEFT) Fund Transfer To Account 3 What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 100 WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account 4 What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 50 Rs 50 RIGHT
0000A Fund Transfer(NEFT) Fund Transfer To Account 5 When you can perform the operation? Morning Hours Morning Hours RIGHT
0000A Fund Transfer(NEFT) Fund Transfer To Account 6 When you can perform the operation? Night Hours WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account 1 FT stands for? Fund Transfer Fund Transfer RIGHT
0000A Fund Transfer(NEFT) Fund Transfer To Account 2 In a day How many time you can do a Fund Transfer? Many WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account 3 In a day How many time you can do a Fund Transfer? 10 WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account 4 What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 50 WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account 5 What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 5 WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account 6 When you can perform the operation? Morning Hours WRONG
0000A Fund Transfer(NEFT) Fund Transfer To Account 7 When you can perform the operation? Evening Time WRONG
0000B Accounts Credit Card 1 FT stands for? Fund Transfer WRONG
0000B Accounts Credit Card 2 FT stands for? Find Transfer WRONG
0000B Accounts Credit Card 3 In a day How many time you can do a Fund Transfer? Many WRONG
0000B Accounts Credit Card 4 In a day How many time you can do a Fund Transfer? 2 WRONG
0000B Accounts Credit Card 5 What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 50 WRONG
0000B Accounts Credit Card 6 What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 10 WRONG
0000B Accounts Credit Card 7 When you can perform the operation? All Day WRONG
0000B Accounts Credit Card 8 When you can perform the operation? Morning Hours Morning Hours RIGHT
0000B Accounts Credit Card 1 FT stands for? Fund Transfer Fund Transfer RIGHT
0000B Accounts Credit Card 2 In a day How many time you can do a Fund Transfer? Many Many RIGHT
0000B Accounts Credit Card 3 What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 50 WRONG
0000B Accounts Credit Card 4 What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 5 WRONG
0000B Accounts Credit Card 5 When you can perform the operation? Morning Hours WRONG
0000B Accounts Credit Card 6 When you can perform the operation? All Day WRONG
0000B Accounts Credit Card 7 When you can perform the operation? Evening Time WRONG
0000B Accounts Credit Card 1 FT stands for? Fund Transfer WRONG
0000B Accounts Credit Card 2 FT stands for? Find Transfer WRONG
0000B Accounts Credit Card 3 In a day How many time you can do a Fund Transfer? Many WRONG
0000B Accounts Credit Card 4 In a day How many time you can do a Fund Transfer? 10 WRONG
0000B Accounts Credit Card 5 What are the charges for doing a Fun transfer of 10,000 Rs.? Rs 50 Rs 50 RIGHT
0000B Accounts Credit Card 6 When you can perform the operation? Morning Hours WRONG
0000B Accounts Credit Card 7 When you can perform the operation? Night Hours WRONG


-------------------------------------------------
What i want from this result is
AtemptNo will be displayed based upon TestID
means suppose u have taken one test that will be attempt no 1
and if took the same test again the attempt will be 2
after that if you took another test AttempNo qill be 1 for that test.

Question is coming twice or more because User_Answer and Right Answer is are different.
it have to display like: User Answer and Right Answer have to come in a single row and question should not be display twice or more?

Thanks in advance

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000