M
M
Mykola2014-10-04 21:39:26
MySQL
Mykola, 2014-10-04 21:39:26

Is such a request possible?

SET @ba = SELECT sum(balans+200) FROM `test_db_vytrat` WHERE id = 10;

INSERT INTO `test_db_vytrat` (`id`, `data`, `cat`, `oper`, `suma_oper`, `balans`, `note`) VALUES (NULL, '2014-10-25', '4', 'dec', '150', @ba, 'hb');

I need to calculate the balance, I want to do it with one request, but how?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
M
Mikola, 2014-10-04
@iSensetivity

In general, he did.

SELECT @ba:= (balans + СУМА) FROM `test_db_vytrat` ORDER BY `id` DESC LIMIT 0 , 1;
INSERT INTO `test_db_vytrat` (`id`, `data`, `cat`, `oper`, `suma_oper`, `balans`, `note`) VALUES (NULL, '2014-10-25', '4', 'dec', '150', @ba, 'hb');

E
Egor Ommonik, 2016-10-24
@m5xim

Swap ssd and hdd. That is, insert a system disk into the disk compartment, and a hard disk as storage into the optibay. These are jokes with Optibey such.
Well, unless of course you run several systems from different disks.

I
iBird Rose, 2016-10-24
@iiiBird

time works in Windows - do not touch! finish the game - the next post on the toaster will be - "the computer does not see any disks. neither HDD, nor SSD ... nothing ... what to do ?!"

M
MINYSMOAL, 2016-10-24
@MINYSMOAL

1. Try changing cables
2. Try updating the ssd firmware

R
Ravil Shaimardanov, 2016-10-24
@ravil666

there was an article about optibey on habré or gigtimes, there were jumpers under the casing, maybe this will help.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question