Results 1 to 5 of 5
Thread: mySQL -
Hybrid View
-
27th February 2009 16:58 #1
mySQL -
, , .
.
`table`, `id`, `expiration_date`, `check`
expiration_date 0 timestamp.
check 0 1, id .
:
:
select * from `table` order by `check` DESC
, check , `expiration_date` - . , check == 1 expiration_date < , check == 0...
.
, .
Hey, mother, I come bearing a gift. I'll give you a hint. It's in my diaper and it's not a toaster.
.
-
27th February 2009 17:13 #2Registered User
Join Date: Jul:2005
Location: Sofiq
Posts: 2,798
""

, ! .Code:SELECT `table`.*, IF(`expiration_date`< CURRENT_TIMESTAMP() AND `check`=1, 0, 1+`check`) as `order` FROM `table` ORDER BY `order` DESC
-
27th February 2009 17:33 #3
, ,
.
?
SELECT * FROM `table`
WHERE `expiration_date`>{_}
ORDER BY `check` DESC
UNION
SELECT * FROM `table`
WHERE `expiration_date`<={_}
-
27th February 2009 17:40 #4Registered User
Join Date: Jul:2005
Location: Sofiq
Posts: 2,798
-
27th February 2009 18:24 #5




Reply With Quote

Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in