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 8798031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:59:07+00:00 2026-06-13T23:59:07+00:00

What I have I’m working on an Android app with a menu of school

  • 0

What I have

I’m working on an Android app with a menu of school canteens. I download data from a remote website and save them to the internal SQLite database to such table (SO Markdown doesn’t support tables, hence I’ll make it a list):

  • ID
  • TEXT – The name of the meal
  • NUMBER – The number of the meal (we can choose from more)
  • ORDERED – Boolean, whether the particular meal is ordered or not
  • DATE – The date (timestamp) when the meal is server

(and a few more unimportant columns)

What I need

I want to provide the user with a list, where for every day when the canteen cooks there is either the meal he has ordered or information, that he hasn’t ordered anything for that day.

The question is, how should look my query when I need to get:

  • Every date that is in the table (once).
  • For each date either the info about the ordered meal, or (if there isn’t any ordered meal) something from which I can tell that the user will be hungry that day.

Because I want my users to be able to see also the meals they didn’t order (so that their friends can look, what they might have), I refuse to keep only the ordered meals.

Thanks in advance for any help.

  • 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-13T23:59:08+00:00Added an answer on June 13, 2026 at 11:59 pm
    SELECT *, MAX(Ordered) FROM MyTable GROUP BY "Date"
    

    The GROUP BY "Date" ensures that you get one result per day; the MAX(Ordered) ensures that that result is one that is ordered, if possible.

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

Sidebar

Related Questions

Have deployed numerous report parts which reference the same view however one of them
I have just tried to save a simple *.rtf file with some websites and
Have a photography site that I want to prevent image copying from. How can
Have created a ATL COM project through which I am inserting Menu Items to
I have a text area in my form which accepts all possible characters from
Have created an android test project and currently trying to write android unit tests
Have a look at the menu link Produkter on http://marckmann.se/ I would like to
I have a view passing on information from a database: def serve_article(request, id): served_article
I have a bunch of posts stored in text files formatted in yaml/textile (from
Have an app that can use tts to read text messages. It can also

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.