Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 302
  • Last Modified:

Select Distinct from one table

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
beegled
Asked:
beegled
1 Solution
 
BulZeyECommented:
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
 
beegledAuthor Commented:
That's exactly it!  Thanks so much.  I really appreciate it.

David
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now