Skip to content
Advertisement

Tag: database

Trying to do basic subtraction from a database table

I’m trying to subtract data based on user input, for example: UPDATE table SET quantity=quantity – * some input value* This is easy if I’m subtracting field by field, where id=1…2…3, but I want to subtract values automatically when I input quantity, so if input is 60, and there is 50 in the first field, remainder would be subtracted from

How can I avoid duplicates accross multiple columns in access?

My question is pretty simple, yet I am unable to find the answer I need. I have an access database with a table called coaches. I have another table called teams, which can have a coach and assistant coach. I need to be able to allow no duplicates across the “Coach” and “Assistant Coach” Fields. Coaches can be both head

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.

Advertisement