Jump to content

Looking for a simple SQL query


kevinkhan

Recommended Posts

Wait, so you want ALL rows to set published=0 when NO rows are published=1?

 

By virtue of binary logic, the database already does this.  If no rows are published=1, and the only two values are 0 and 1, then all the rows are already zero.

 

-Dan

Wait, so you want ALL rows to set published=0 when NO rows are published=1?

 

By virtue of binary logic, the database already does this.  If no rows are published=1, and the only two values are 0 and 1, then all the rows are already zero.

 

-Dan

 

no i would like

ALL rows to set published=0 when ALL rows are published=1?

I don't follow what's desired here.

Once all articles are marked "published" he wants to "reset" the table so that they're all unpublished again.  In English, "Update the table, set published = 1 where ALL ROWS are published = 0." 

 

I can see why you're confused.

 

-Dan

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.