Solved

Select Distinct from one table

Posted on 2003-12-01
2
267 Views
Last Modified: 2009-12-16
Hello,

This should be farily easy but I just can't seem to get it.  I am tracking 404 errors on a web site in a table and reidrecting the user if the URL they are trying to reach exists in another table.  What I want to do basically is create a view that looks at the column in the table with the error log that contains the URL that users have tried to reach and compare that to the column in the table that contains redirct urls.  If the url in the log table does not appear in the table of redirects, I want all of the columns of data from that record in the log table to appear in the view.  I don't know if I'm making any sense or not.  Any help is greatly appreciated.

Thanks,

David
0
Comment
Question by:beegled
2 Comments
 
LVL 4

Accepted Solution

by:
BulZeyE earned 50 total points
ID: 9853539
So you are basically looking for something like:

SELECT *
  from tblLogError le
where not exists (select *
                           from tblURLRedirect ur
                          where ur.OrigUrl = le.ErrorUrl)

or

SELECT *
  from tblLogError le
where ErrorULR not in(select ur.OrigUrl
                           from tblURLRedirect ur)

?? is that what you want?  A little more info like table/column...??



0
 

Author Comment

by:beegled
ID: 9853735
That's exactly it!  Thanks so much.  I really appreciate it.

David
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now