Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesDatabase Management

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 Dev Shed Forums Sponsor:
  #1  
Old November 11th, 2011, 11:51 AM
TSquared TSquared is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2011
Posts: 1 TSquared User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 17 m 45 sec
Reputation Power: 0
Help with Query - Need Distinct Names

I have this query:

Code:
SELECT projects.id, projects.proj_name, items.item, items.date_entered, users.first_name, users.last_name, users.Active
FROM ([SELECT users_project.proj_id
FROM users_project
WHERE (users_project.users_id=1)]. AS x INNER JOIN projects ON x.proj_id = projects.id) INNER JOIN (users INNER JOIN items ON users.id = items.users_id) ON projects.id = items.projects_id
GROUP BY projects.id, projects.proj_name, items.item, items.date_entered, users.first_name, users.last_name, users.Active
HAVING (((items.date_entered) Not Between (Date()-Weekday(Date())+1) And (Date()-Weekday(Date())+7)))
ORDER BY users.last_name;


It gives me this result:

Project 1 This is item 1 proj1 11/4/2011 Tom Jones
Project 1 This is item 2 proj 1 11/4/2011 Tom Jones
Project 2 This is item 4 proj 2 11/5/2011 Tom Jones
Project 3 This is item 7 proj 3 11/4/2011 Tom Jones
Project 1 This is item 6 proj 1 11/5/2011 Harry Smith

I just need a row per each person, so in this case just two rows. How do I modify the query to do this? Any help is appreciated. THanks

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Help with Query - Need Distinct Names

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap