Skip to content
Advertisement

MYSQL Specific Order With Conditionals

Okay… I have three columns that I’d like to order based on their conditions. Column 1 (INT) = last_reboot Column 2 (BOOL) = onlinecheck Column 3 (INT) = drive_use I’d like “last_reboot” to be default and ordered descending. If “onlinecheck” = 0, I’d like it to be at the top of my query else ordered by the the “last_reboot” desc.

Unable to join queries

I hope you’re able to help with this, it is creating a lot of unnecessary work for me… I have a lot of users that are assigned a unique session_id each time they start the game. This means they can get multiple session_id ‘s in a single day if they crash and/or just restart the app. I want to be

MySQL – Issue with running the INSERT INTO query

Can someone tell me what did I do wrong on this insert statement: INSERT INTO inventory (typer, prodid, Description, Loc, Price, Total, Available) Values(‘Head’, ‘H001’, ‘KosMom – Blue’, ‘G:Tesd’, ‘…

which query is better to get DATE + 23:59:59

SELECT DATEADD(hh, 23, DATEADD(mi,59 , DATEADD(ss,59 , ‘2019-09-22 00:00:00.000’))) SELECT DATEADD(dd,1, DATEADD(ss, -1 , ‘2019-09-22 00:00:00.000’)) result 2019-09-22 23:59:59.000 2019-09-22 23:59:…

Return result of CASE with Posgres SQL function

I am trying to write a simple SQL function that will be used as a computed field in Hasura.io platform. CREATE OR REPLACE FUNCTION calling_mode(calling_row calling, hasura_session json) RETURNS text …

Advertisement