Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old December 12th, 2002, 11:25 AM
justravis justravis is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: San Diego, CA
Posts: 65 justravis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 m 12 sec
Reputation Power: 2
Send a message via AIM to justravis Send a message via Yahoo to justravis
Empty Table Ruins Query

My goal is to create a query that selects authors that are NOT associated with a certain article. This would include authors that are not associated with any articles.

Here are my tables:

AUTHOR
id
first
mid
last

ARTICLE
id
title
body

ART_AUTH (link table)
artid
authid

Here is my query thus far:
SELECT author.id, author.first, author.mid, author.last, FROM author, art_auth WHERE author.id<>art_auth.authid OR (author.id=ar
t_auth.authid AND art_auth.artid<>$artid)

It works GREAT until the link table is empty. Then it returns 0 rows. In that case, I would like it to just return all the authors in the authors table. Have any sugestions???

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > Empty Table Ruins Query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT