About 72 results
Open links in new tab
  1. SQL Server - INNER JOIN WITH DISTINCT - Stack Overflow

    I am having a hard time doing the following: select a.FirstName, a.LastName, v.District from AddTbl a order by Firstname inner join (select distinct LastName from ValTbl v where a.Las...

  2. Using DISTINCT inner join in SQL - Stack Overflow

    Oct 15, 2015 · I did a test on MS SQL 2005 using the following tables: A 400K rows, B 26K rows and C 450 rows. The estimated query plan indicated that the basic inner join would be 3 times slower than …

  3. sql server - DISTINCT Query on an INNER JOIN - Database …

    1 Your DISTINCT is applied to ALL columns in your SELECT statement, not just the one you put it next to in your query. Your DISTINCT and GROUP BY are, at the moment, doing the same exact thing. …

  4. sql server - How to SELECT DISTINCT records with INNER JOIN?

    Jun 22, 2021 · Then using this new column (FirstFourLastName), I wrote code for Inner Join in SQL with an aim to assign the Unique "Client Code" to each record in table FMAY. I am able to get the correct …

  5. sql - Getting distinct rows from a left outer join - Stack Overflow

    Apr 10, 2013 · select distinct Table1.Id as Id, Table1.Name, Table2.Description from Table1 left outer join Table1Table2Map on (Table1Table2Map.Table1Id = Table1.Id) left outer join Table2 on …

  6. mysql - Select distinct records on a join - Stack Overflow

    SELECT items.ItemName, items.ItemId FROM items JOIN sales ON items.ItemId = sales.ItemId WHERE sales.StoreID = ? ORDER BY sales.SaleWeek DESC; However, this is returning multiple …

  7. sql - SELECT DISTINCT values after a JOIN - Stack Overflow

    Dec 22, 2009 · 1, 1, motorcycle, 2009 1, 2, car, 2008 , 3, van, I need to require a distinct car id but this happens before the JOIN and so has no effect at all. How can I get the uniqueness with the JOIN?

  8. sql - Joining with a distinct column - Stack Overflow

    Nov 16, 2021 · How do I join a table with a distinct value in a SQL view? My code looks like below Select a, b, c, d from TableA inner join TableB on TableA.account = TableB.account ...

  9. sql - MySQL Select Distinct with Left Join? - Stack Overflow

    Jul 11, 2016 · mysql sql select left-join distinct edited Jul 11, 2016 at 17:39 asked Jul 11, 2016 at 16:45 Katrina

  10. SQL query to find distinct values in two tables? - Stack Overflow

    SQL query to find distinct values in two tables? Asked 14 years, 3 months ago Modified 5 years, 6 months ago Viewed 121k times