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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:21:29+00:00 2026-05-26T12:21:29+00:00

I need to give my client the option to publish some posts with same

  • 0

I need to give my client the option to publish some posts with same name in different categories. the CMS is closed and I can’t add anymore fields…
There is a spare field which I can use to identify posts as identical, but I don’t won’t a situation where to exact posts will load (posts in my case are images).

So I figured my client can specify identical “field” for all identical posts.

The problem is that the default for the field is null. if i’ll use distinct, only one result will come from all the non-identical posts (all of them by default = null)…

Is there a way to select distinct “field” if not null?

I tried looking and trial and error with the above but it didn’t work for me…

The query itself is quite simple…

SELECT id,introtext,publish_up,publish_down 
from #__content 
WHERE catid IN(936,937,940,959,972,988,991) AND state = 1 
  AND ( publish_up = "0000-00-00 00:00:00" OR publish_up <= "2011-10-30 12:12:59" )
  AND ( publish_down = "0000-00-00 00:00:00" OR publish_down >= "2011-10-30 12:12:59" ) 

--removed duplicated query

Will appreciate any clue or directions…
Thanks!
Yanipan

  • 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-26T12:21:30+00:00Added an answer on May 26, 2026 at 12:21 pm

    Which field is by default NULL? I’ll just name it X and you can change it accordingly:

    SELECT DISTINCT id,introtext,publish_up,publish_down,IFNULL(X,id) AS distinct_field 
    from #__content 
    WHERE catid IN(936,937,940,959,972,988,991) AND state = 1 
    AND ( publish_up = "0000-00-00 00:00:00" OR publish_up <= "2011-10-30 12:12:59" )
    AND ( publish_down = "0000-00-00 00:00:00" OR publish_down >= "2011-10-30 12:12:59" ) 
    

    I hope I got it right!

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

Sidebar

Related Questions

I need to give one client the ability to convert some videos to f4v
I have a set of different interfaces and I need to give them access
Anybody please give some useful links on this topic.i need to create a content
After experiencing some performances issues on my client side, we decided to give a
I need to give to a java client a way to send files to
I need some piece of software that will fulfill the following functions: 1. Give
I need to give my client the ability to change his pages through tinyMCE.
I need to give the countdown as shown here , for each item using
I have a problem where I always need to give simple access to my
I'm in a ASP.NET project where I need to give several parameters to the

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.