![]() ![]() GROUP BY statement.f1, statement.f9, allocation_2., allocation_2. The former is standard and the latter is not. in Microsoft Press training kit for 70-461 exam, 'Querying Microsoft SQL Server', they say 'As an example of when to choose the standard form, T-SQL supports two not equal to operators: <> and. Query: SELECT statement.f1, statement.f9, allocation_2., allocation_2.sumoff6įROM allocation_2 LEFT JOIN statement ON allocation_2.=statement.f1 Yes Microsoft themselves recommend using <> over specifically for ANSI compliance, e.g.Look at the first row, which should not be there because f9 = sumoff6. As you see below for example it still brings up the result if its the same. The result i want is if f1 = f3 and f3 sumoff6 then display the output. Keeep in mind though that there may be more rows in the statement table. I need for f1 columns to match on both tables but if their values on the sumoff6 and f9 columns do not match then display them and subtract them. For the record with product1 (d1 table) there is only one record from d2 table that meets the condition: d1.product>d2.product - just product1. The results I am getting show equal values that are already on both tables. It takes a first record from the left table (d1), then searches through the right table (d2) and pick from the right table all records that meet the join condition. ![]() If they are different i would like to subtract them. I am doing a left join query to compare the two tables for any values that do not equal each other on f9 and sumoff6 columns ONLY if the F1 columns are the same. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |