Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
ajmaly
Starting Member
11 Posts |
Posted - 2010-07-29 : 11:37:08
|
Hello, Please help me writing a stored procedure with below situation, Table A output, AJMAL TAMANNA TINKU Table B output, AJMAL TAMANNA TINKU1 If Table A and Table B each row value match with each other, then return "YES", else "NO" ajmal |
|
X002548
Not Just a Number
15586 Posts |
Posted - 2010-07-29 : 12:24:53
|
[code]CREATE TABLE #TableA (col1 varchar(25))CREATE TABLE #TableB (col1 varchar(25))GOINSERT INTO #TableA (col1)SELECT 'AJMAL' UNION ALL SELECT 'TAMANNA' UNION ALLSELECT 'TINKU ' UNION ALLSELECT 'Brett'INSERT INTO #TableB (col1)SELECT 'AJMAL' UNION ALL SELECT 'TAMANNA' UNION ALLSELECT 'TINKU ' UNION ALLSELECT 'kaiser'GO SELECT a.Col1, b.Col1, CASE WHEN a.Col1 = b.Col1 THEN 'Yes' ELSE 'No' END AS ColCompare FROM #TableA aFULL JOIN #TableB b ON a.Col1 = b.Col1GODROP TABLE #TableA, #TableBGO [/code]Brett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxAdd yourself!http://www.frappr.com/sqlteam |
 |
|
|
|
|