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

  • Home
  • SEARCH
  • 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 408307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:40:47+00:00 2026-05-12T17:40:47+00:00

Let’s say that you are limited to use only this syntax (you can’t use

  • 0

Let’s say that you are limited to use only this syntax (you can’t use aggregation functions like MAX or MIN, and neither you can’t use GROUP BY clauses; please don’t ask me why):

{SQL query} ::= SELECT [DISTINCT | ALL] [TOP {integer}]
                {select_list}
                FROM {table_reference}
                [WHERE {search_condition}]
                [ORDER BY {orderby} { ',' {orderby} } ]

Let’s say that we have an ITEM table, where the identifier is called ITEM_ID. For a given ITEM_ID you could have many rows with the same ITEM_ID but different SHIP_DATE. How would you write a query to return only the ITEMS with the most recent SHIP_DATE given the previous syntax?

I already tried using TOP N (to retrieve the first row in the result set) combined with an ORDER BY (to sort from the max SHIP_DATE to the min SHIP_DATE). Any ideas or suggestions?

What I tried is something like this:

SELECT TOP N * FROM ITEM WHERE ITEM_ID='X' ORDER BY SHIP_DATE DESC 

Actually the previous query seems to be working, but I’m wondering if there is a better way to do it.

This is not homework, I need to create a query using the supported FileNet P8 syntax: http://publib.boulder.ibm.com/infocenter/p8docs/v4r5m1/index.jsp?topic=/com.ibm.p8.doc/developer_help/content_engine_api/guide/query_sql_syntax_ref.htm

  • 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-05-12T17:40:47+00:00Added an answer on May 12, 2026 at 5:40 pm

    Assuming that ITEM.ship_date doesn’t fall on the same date for any other ITEM record:

      SELECT TOP x
             i.item_id,
             i.ship_date
        FROM ITEM i 
    ORDER BY i.ship_date DESC
    

    …where x is the number of unique/distinct ITEM.item_id records. How’d you’d get that without being able to use COUNT…

    You have to use ORDER BY i.ship_date DESC in order to have the most recent ship_date records at the top of the result set.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I can call a method like this: core::get() . What is the
Let's say that I have a set of relations that looks like this: relations
Let’s say I have a number like 0x448 . In binary this is 0100
Let's say I have a text file composed like this ##### typeofthread1 ##### typeofthread2
Let's say there is a graph and some set of functions like: create-node ::
Let's say I have table with column 'URL' whrere I store urls like this
Let's say I dynamically create a timer like this: System.Timers.Timer expirationTimer = new Timer(expiration
Let's say I have this text that I want to display in an HTML
Let's say I have a structure named vertex with a method that adds two
Let's say on a page I have alot of this repeated: <div class=entry> <h4>Magic:</h4>

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.