Sybase

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



Go Back   Tutorialized ForumsDatabasesSybase

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 Tutorialized Forums Sponsor:
  #1  
Old October 19th, 2012, 12:03 PM
dmge dmge is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 1 dmge User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 m 25 sec
Reputation Power: 0
Merge files

Hi All,
I have two tables that I need to merge, however there is a catch, on table "B" , not all depts have data in grades from 3-8, if data is missing I would like to have an empthy row with the grade only. Please see below

Table "A" has a field column named grade:

SELECT A.grade
FROM A
GROUP BY grade
HAVING (((A.grade) In (3,4,5,5,6,7,8)));


Table "B"

SELECT [B].yr, [B].grade, [B].dept
FROM [B]
GROUP BY [B].yr, [B].grade, [B].dept
HAVING ((([B].yr)=2012))
ORDER BY [B].Dept;


OUTPUT
yr grade dept
2012 6 2030
2012 7 2030
2012 8 2030

Desired final ouput
yr grade dept
2012 3 2030
2012 4 2030
2012 5 2030
2012 6 2030
2012 7 2030
2012 8 2030


Is this possible?
Please advise

DG

Reply With Quote
Reply

Viewing: Tutorialized ForumsDatabasesSybase > Merge files


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 - 2017, Jelsoft Enterprises Ltd.

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