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 |
raja537
Starting Member
2 Posts |
Posted - 2012-07-12 : 09:50:16
|
I need to compare two columns from two table one column form each table and I need to use <= operator to compare the things and I need to update the column values in other table.If the comparison is false I need to set the other column value to 0 or something value. |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-07-12 : 10:08:50
|
Please give table structure, sample data and wanted result. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-07-12 : 10:21:33
|
doesnt sounds like join will do job for you. can you illustrate your scenario with sample data?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
raja537
Starting Member
2 Posts |
Posted - 2012-07-12 : 21:45:28
|
It an stored procedure ,likecreate proc proc name@field1 varchar2(10)@field1 varchar2(10)@filename1 varchar2(10)@filename2 varchar2(10)where the field1 is column name and field2 is other column name from two tables filename1 and filename2 I need to insert date into temp data table like select * into temp from filename 1 ...I need to insert two table all values into temp table without any join conditions..Let me know the other solution..Avi |
 |
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2012-07-13 : 06:30:40
|
Why do you NEED to insert without any join conditions? What if inserting using a join takes .0001 seconds? Sounds like homework...How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-07-13 : 10:39:26
|
quote: Originally posted by raja537 It an stored procedure ,likecreate proc proc name@field1 varchar2(10)@field1 varchar2(10)@filename1 varchar2(10)@filename2 varchar2(10)where the field1 is column name and field2 is other column name from two tables filename1 and filename2 I need to insert date into temp data table like select * into temp from filename 1 ...I need to insert two table all values into temp table without any join conditions..Let me know the other solution..Avi
are you trying to merge data from both tables into same temp tables? are structures of both tables same? if yes, use UNION or UNION ALL------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|