This week's book giveaway is in the Open Source Projects forum.
We're giving away four copies of Eclipse Collections Categorically: Level up your programming game and have Donald Raab on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

How to query for this

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All

I'm java developer & don't know much about SQL. So plz help me out.

I want a query to select 3 fields from the table having 2 primary_key fields.

This is my table structure

Name Null? Type
------------------------------- -------- ----
EMPCD0 NOT NULL VARCHAR2(6)
WEF0 NOT NULL DATE
PGM VARCHAR2(4)

Now i want to select latest PGM of number of employees

select to_char(max(e.WEF0)),e.EMPCD0 from dismi_tprogempm e group by e.EMPCD0

This query just shows EMPCD0 & WEF0. if we add e.PGM in that it gives error.

Plz suggest a query to find latest records with all information

Thanks In Advance

 
Chandu Dharmadhikari
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey

I did a query 4 this

Thanx
 
Let nothing stop you! Not even this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic