User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 429,884 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,349 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser: Programming Forums
Views: 545 | Replies: 3 | Solved
Join Date: Apr 2007
Location: Birmingham
Posts: 378
Reputation: Fungus1487 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 37
Fungus1487's Avatar
Fungus1487 Fungus1487 is offline Offline
Posting Whiz

Confused?

  #1  
Mar 20th, 2008
Hello all,

hope i can get some help on this one as im not brilliant with my database scripts.

I have table "A" and table "B", table "A" contains information on a portfolio and table "B" is a joining table which connects this table to a user of the system with a 1-to-many relationship.


I am looking to return all records in table "A" that are not connected to a user in table "B"

i have tried this

SELECT a.* FROM a LEFT JOIN b ON a.id = b.id WHERE b.userid <> 1

but i know this is incorrect but cannot figure out myself how to achieve what i want.

Hopefully someone can point me in the right direction.
When Autumn Falls [ http://www.whenautumnfalls.co.uk ] &&
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MS SQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the MS SQL Forum

All times are GMT -4. The time now is 8:36 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC