April 11, 2012 at 2:22 am
There is only one database.
I have got 1 table with the fields qid,qans.
One more table with the fields qid,uans,result.
I want to compare each record of qans and uans and if they match then answer should be 1 and it should store value 1 in result respective row.
If it does'n match then it should store value 0 in the result field of respective row.
How to write this code and where?
April 11, 2012 at 5:01 am
Can you supply DDL tables and respresentative data, search this forum for how to request help and i will have a look at what you ask
***The first step is always the hardest *******
April 11, 2012 at 8:07 am
http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
For details about posting ddl and sample data see the first link in my signature.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply