Click here to Skip to main content
Click here to Skip to main content
Articles » Database » Database » General » Alternatives
 
Alternatives (1)

JOIN Instead of Repeating a Subquery

, 2 Feb 2011
Rather than use multiple subqueries to extract TOP 1 data, this shows you how to use a single TOP 1 JOIN.

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

6 Feb 2011
Goutam Patra
As an alternate, I would like to share the following query using the previous table definition using RANK:DECLARE @FirstTable table(FirstName varchar(20))DECLARE @SecondTable table (ID int, FirstName varchar(20), LastName varchar(20), FirstNameHashCode varchar(20), ...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

AspDotNetDev
Web Developer
United States United States
  • Managing Your JavaScript Library in ASP.NET (if you work with ASP.net and you don't read that, you are dead to me).
  • Graduated summa cum laude with a BS in Computer Science.
  • Wrote some articles and some tips.
  • DDR ("New high score? What does that mean? Did I break it?"), ping pong, and volleyball enthusiast.
  • Software I have donated to (you should too):

| | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 3 Feb 2011
Article Copyright 2010 by AspDotNetDev
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid