Home » SQL & PL/SQL » SQL & PL/SQL » Query Help
Query Help [message #446297] Sun, 07 March 2010 11:59 Go to next message
h0neydip
Messages: 3
Registered: March 2010
Junior Member

SQL> select * from year;
	YEAR   YEARGOAL
      1992       5000
      1995       5000
      1993       5000
      1994       5500

SQL> select * from gift;
    AMOUNT       YEAR    DONORNO
       939       1993        101
       899       1993        102
       111       1994        102
       373       1992        101
       543       1992        102
       297       1993        110
        84       1994        110
       823       1995        110
       887       1992        111
       332       1993        111
       882       1994        111
       666       1992        112
       812       1995        112
       560       1994        113
       223       1992        114
       835       1994        114
       558       1993        115
       268       1993        116
       345       1994        116
       265       1995        116
        82       1992        117
       657       1995        117
        17       1995        118
       186       1992        119
       772       1993        119
      1185       1992        103
      1362       1993        103
      5208       1994        103
      1865       1995        103
       667       1993        105
        60       1995        106
       332       1994        107
       674       1993        108
       155       1994        108
       838       1992        109
       499       1994        109
       582       1992        110


SQL> select * from donor;

   DONORNO DLNAME          DFNAME              DPHONE DS DCITY
---------- --------------- --------------- ---------- -- -------------
       101 Abrams          Louis                 9018 GA London
       102 Aldinger        Dmitry                1521 GA Paris
       103 Beckman         Gulsen                8247 WA Sao Paulo
       104 Berdahl         Samuel                8149 WI Sydney
       105 Borneman        Joanna                1888 MD Bombay
       106 Brock           Scott                 2142 AL London
       107 Buyert          Aylin                 9355 AK New York
       108 Cetinsoy        Girwan                6346 AZ Rome
       109 Chisholm        John                  4482 MA Oslo
       118 Herskowitz      Thomas                6872 MT London
       119 Jefts           Robert                8103 ME Oslo
       110 Crowder         Anthony               6513 NC Stockholm
       111 Dishman         Michelle              3903 NC Helsinki
       112 Duke            Peter                 4939 FL Tokyo
       113 Evans           Ann                   4336 GA Singapore
       114 Frawley         Todd                  4785 MN Perth
       115 Guo             John                  6247 MN Moscow
       116 Hammann         John                  5369 ND Kabaul
       117 Hays            Cami                  1352 SD Lima


what would the query be toList the donor number and last name of donors who did not contribute in 1994, in order by donor number. Your help is greatly appreciated
Re: Query Help [message #446298 is a reply to message #446297] Sun, 07 March 2010 12:07 Go to previous messageGo to next message
BlackSwan
Messages: 25042
Registered: January 2009
Location: SoCal
Senior Member
start with following SQL

SELECT DONORNO from donor
MINUS
SELECT DONORNO from GIFT
WHERE YEAR = 1994
Re: Query Help [message #446302 is a reply to message #446297] Sun, 07 March 2010 12:57 Go to previous message
Michel Cadot
Messages: 64130
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Do not post the content of your tables but post the create table and insert statements to have this content.
And post the result you want with this data.
And ALWAYS post your Oracle version (with 4 decimals).

Regards
Michel
Previous Topic: Trigger sum constraints
Next Topic: Help Creating Single Table Cluster
Goto Forum:
  


Current Time: Wed Dec 07 06:56:43 CST 2016

Total time taken to generate the page: 0.16152 seconds