Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8460245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:33:11+00:00 2026-06-10T13:33:11+00:00

any body can help me please? i want to querying from my table, the

  • 0

any body can help me please? i want to querying from my table, the purpose is to show which employees are selling over 100 pieces. i have done that query and works,

but the problem arises when I want to display the last time of sale of each employee (who sell goods over 100 pieces)

i have table TBL_SALES like

no   employee_id   name          pieces   sl_time
---|-------------|-------------|--------|----------
1  |     1       | bungdito    | 60     | 2012-03-29 22:20
2  |     1       | bungdito    | 40     | 2012-03-05 18:00
3  |     1       | bungdito    | 50     | 2012-02-18 08:00
4  |     2       | addheat     | 120    | 2012-02-12 09:30
5  |     3       | angga       | 20     | 2012-01-18 10:45
6  |     4       | dimas       | 50     | 2012-01-01 08:30

when i use query like this

select * from 
( 
  select EMPLOYEE_ID, NAME, sum(PIECES) PIECES from 
  ( 
    select EMPLOYEE_ID, NAME, PIECES
    from DB_SCHEMA.TBL_SALES 
  )  
  group by EMPLOYEE_ID, NAME
) where PIECES > 100

i have this correct result

 employee_id   name          pieces 
-------------|-------------|--------
     1       | bungdito    | 150    
     2       | addheat     | 120    

the result above is correct,

but what I need is complete with each employees last transaction time

i have tried to make query but still not correct

select * from 
( 
  select EMPLOYEE_ID, NAME, sum(PIECES) PIECES, SL_TIME

  ( 
    select EMPLOYEE_ID, NAME, PIECES,(select max(WAKTU) SL_TIME from DB_USER.TR_PELANGGARAN where TB_SALES.EMPLOYEE_ID = EMPLOYEE_ID from TB_SALES) SL_TIME
    from DB_SCHEMA.TBL_SALES 
  )  
  group by EMPLOYEE_ID, NAME, SL_TIME
) where PIECES > 100

using that query i still have the wrong result (see the sl_time is same between bungdito and addheat) like :

    employee_id   name          pieces   sl_time
   -------------|-------------|--------|----------
        1       | bungdito    | 150    | 2012-03-29 22:20
        2       | addheat     | 120    | 2012-03-29 22:20

what i need is like this below:

employee_id   name          pieces   sl_time
-------------|-------------|--------|----------
     1       | bungdito    | 150    | 2012-03-29 22:20
     2       | addheat     | 120    | 2012-02-12 09:30
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T13:33:13+00:00Added an answer on June 10, 2026 at 1:33 pm

    Try this:

      select EMPLOYEE_ID, NAME, sum(PIECES) PIECES, MAX(SL_TIME)
      from DB_SCHEMA.TBL_SALES   
      group by EMPLOYEE_ID, NAME
      having sum(PIECES) > 100
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Any body please can please help me, how to center a JFrame on Mac.
i am new to iPhone programming... can any body help me out please... in
Can any body help me out how to clear the items in the list
can any body help me the create a menu(Home, My Quote, Send a Quote)
can any body help me on separating this example of data that i need
Can any body help me to convert the following SQL query in LinqToSql syntax.
hi guys can any body help me to figure out that how i can
Any body please tell me how we can decrease or increase size of text
Can anybody please help me with a link or document to run jbpm-5.2 on
Can anybody please help me with this as I have no idea why public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.