Questions tagged as 'select'

3
answers

Select records from a table where the record of a related table is a specific value

I have a table of technical calls and a table of calls. Each 'CALL' has several 'CALLS' and it is in the calls that the field defines the status of the call (Open, Closed, In Progress, Suspended, etc ...) Currently, when I need to list only op...
asked by 24.03.2014 / 15:42
2
answers

SELECT column type DATE by HH24: mm: ss

Hello, I have 2 DATE fields, depending on the snippet below: ...hr_inicio DATE NOT NULL, hr_fim DATE NOT NULL, ... And I need to query these fields using only the values for the HH2...
asked by 11.12.2018 / 19:11
3
answers

problem with select case

I'm doing select with case comparing different statuses of the same field and counting them in separate columns. The problem is that the first column gets NULL until the list of the second ends the count. Then this is reversed. My quer...
asked by 31.08.2018 / 14:03
1
answer

Edit select showing bank value and showing other table options

   I have the table that registers a user (gr_entidade) and that has a connection with a user status table (gr_entidade_status). I want the edit form (editing_user.php) to display the value in the database, but I can see the other items in the t...
asked by 28.12.2017 / 14:51
2
answers

Record count

I have a table named cad_faltas , it has the fields: id int(11) id_cad_alunos int(11) falta varchar(8) idcurso int(11) The falta field receives the data AWAY and / or PRESENT. The question is, is there any possibility of doing a co...
asked by 20.09.2017 / 16:07
1
answer

Using data from one select within another?

Two tables tbl_orcamento and tbl_itens the table budgets have a column with the following statuses. 1 = orcamento aprovado 2 = ordem de compra emitida 3 = ordem de compra aprovada The tbl_itens has some columns I will l...
asked by 24.04.2018 / 20:35
1
answer

SQL query with subquery and IN command

I need to do the following. So-and-so has several models of cars. I want to list other users who also have 3 specific models of car that so and so. What I did: $iduser = id do fulano $mod1 = modelo de carro 1 de fulano $mod2 = modelo de ca...
asked by 02.10.2017 / 08:05
1
answer

Join the result of two Select's commands - PostgreSQL

My need is to join the result of two select's commands so that I get everything returned at once, for example in this command: SELECT codigosuprimento, suprimento, count (codigosuprimento) quantidade, estoqueminimo, count (codigosuprimento) -...
asked by 13.10.2017 / 19:36
1
answer

Save value of a select and display

I'm developing a CRUD from a web system. In the employee's registry I use two select elements to display the options, when registering everything works ok, the information goes to the bank. The problem is when you click edit and bring this infor...
asked by 20.08.2017 / 20:35
1
answer

I need to select sequences of numbers in a field of a table column

I have a 'Text' column in my 'process' table. Text consists of a VARCHAR (220), in this text I need to identify a specific word pattern. In this case a sequence of numbers with a "-" to separate: '1234-567' - There are 4 digits followed by '...
asked by 05.04.2017 / 18:22