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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:27:29+00:00 2026-05-25T11:27:29+00:00

In my Sql, I want to group by some columns having some conditions ,

  • 0

In my Sql, I want to group by some columns having some conditions , so for other column, they are date type. I just want to manually return null for them, But i don’t know how.
Can you give me some advice how to return null for date type column? To simply use NULL doesn’t work in Apache Derby which is odd.

I am also interested in the answer for other database. If you can also answer it, it will be great.

EDIT

Reply to comment, I want
select NULL from TABLE, and NULL stands for an empty value of DATE type column. I just want to return a NULL value manually.But it throws exception tells me NULL is invalid. Is that possible?

EDIT

I found an workaround to return a constant value for date type in Derby. That is using Date(789) which is date function in derby. But I am still insterested in how to return an empty constant value for Date?

EDIT

NULL in query in Derby must be casted to correct type. which is a bit different.

  • 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-25T11:27:30+00:00Added an answer on May 25, 2026 at 11:27 am

    It should use cast(null as DATE) AS START_DATE expression. As in the link.

    I just add here for others to find it out easily. One thing interesting is even the column START_DATE is NOT NULL, I can still fake a NULL return value for this column. Actually it should be , not a surprise at all here,right?

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

Sidebar

Related Questions

I am using Oracle SQL and I want to group some different rows that
How can I using group by with union in T-SQL? I want to group
I am writing some new SQL queries and want to check the query plans
In SQL Server, I have a table where a column A stores some data.
I recently asked this question here and got some great answers! Custom SQL GROUP
I want to select data from following table group by weeks Date Product Name
I'm really not good with SQL and i just want to write a query
I want create a role in SQL server 2008, which will allows specific group
I want to ask how other programmers are producing Dynamic SQL strings for execution
I've written a database generation script in SQL and want to execute it in

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.