Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Tried but not able to do it Expand / Collapse
Author
Message
Posted Wednesday, April 11, 2012 2:22 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, April 11, 2012 2:22 AM
Points: 1, Visits: 8
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?
Post #1281374
Posted Wednesday, April 11, 2012 5:01 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, September 8, 2014 2:40 PM
Points: 271, Visits: 1,020
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 is always the hardest
Post #1281431
Posted Wednesday, April 11, 2012 8:07 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 2:34 PM
Points: 12,923, Visits: 12,342
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 Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1281558
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse