Solved

Select Distinct from one table

Posted on 2003-12-01
2
257 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
Comment Utility
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
Comment Utility
That's exactly it!  Thanks so much.  I really appreciate it.

David
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

772 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

9 Experts available now in Live!

Get 1:1 Help Now