Questions tagged as 'case'

1
answer

How to select a switch / case statement with each click on the button

I would like to make a list of A-Z . One detail, is based on breaking / dividing this list (gem) alphabet into parts: Although my difficulty is in, after being clicked on the button, the same bring the list like this: First click...
asked by 14.04.2016 / 02:38
1
answer

Oracle where case

I need to create a condition in where according to boolean . If% of_% then I will select lines with final values larger than expected ( boolean = true , etc) if it is ConfirmedVolume > ExpectedVolume I select ever...
asked by 31.08.2018 / 14:39
1
answer

Query on sql server with different value depending on some variables

Good afternoon I have the following query: select distinct(T.Grupo) 'Grupo', MAX(G.Descricao) 'Grupo', sum(E.QtdCat*S.FactConvEst) 'M2 cativos' from EncLin as E INNER JOIN Stock as s on s.CodProd=e.CodProd inner join terceiros as t on t.tercei...
asked by 07.11.2017 / 18:23
1
answer

Case MySql returning blob type

I created a MySQL search query using case inside it. The problem is that when returning the value of the column that is of integer type, the value comes with the response blob . Here is the SELECT with the result of the query bel...
asked by 29.11.2017 / 13:26
2
answers

Use IF function in SQL as if it were excel [closed]

Is there a function in SQL equivalent to IF ( SE ) of excel? I need to do a logical test that in excel I would write =SE(B1_UM = "UN"; D2_QUANT / B5_QE1;D2_QUANT) . Here is my query: SELECT D2_FILIAL, // Um monte de...
asked by 16.05.2018 / 20:43
2
answers

Change elseif code to switch case

I'm having trouble changing a code I made in else if to switch case . I'm not getting the code to work, it gets values and operation by $_GET and does the selected operation: I leave the code here: if((!is_numeric...
asked by 07.07.2016 / 15:16
2
answers

Checking column padding with CHECK

I'm creating the DB for my TCC and the table Clients are: create table clients( id serial primary key, name varchar(255), cpf varchar(11), cnpj varchar(14), .... I thought of doing a CHECK limiting the OR fill of the CPF or CNPJ, in case th...
asked by 17.08.2017 / 00:58
2
answers

how to use the case with a select coming from html

Good morning, I need to pull data from the database, but wanted the user to choose from which data what value to search. My code html : <head> <title></title> </head> <body> <form method="POST"...
asked by 24.02.2017 / 14:16
1
answer

Using Switch Case for Intervals

My teacher passed an exercise in which we should use the cases of a switch to handle intervals, he said strictly that we should use the switch and we can not use if nor while/do . I've tried the following code: switch(saldo)...
asked by 24.11.2017 / 18:17
0
answers

Case nested inside another case

I have a lot of questions about CASE ANINHADO. I have to make an interest calculation that depends on some variables and I'm not able to set up this case, so I need your help to set it up. E1_VENCREA GETDATE ZERO (0) because you still...
asked by 20.07.2016 / 21:57