Questions tagged as 'select'

3
answers

fill field select javascript / jquery

Hello, I need to fill a select field with the return of this function, in this example, the variable RES returns: <option value="">setor 1</option> Just this, I need it to become one of the options in my select field, but nothin...
asked by 19.05.2016 / 22:10
1
answer

Select in SQL Server with index

I would like to know if it is possible to make a select in the Sql Server of a table that does not have an index column, but in this select it presents a sequential index column in ascending order. Ex. Table: Letters Coluna D E S And maki...
asked by 27.08.2014 / 17:08
1
answer

Query joining two tables and populating fields conditionally

I'm a beginner in SQL and would like to know if they could help me with an issue. I have two tables, one is Cadastro_Func and the other CadastroFocal . 'Cadastro_Func' has the columns: 'Nickname' 'Name' 'Cargo' 'Register_Foca...
asked by 17.10.2018 / 05:42
1
answer

Insert text with double quotation marks in mysql database

I am using the following code to insert text with double quotes in a mysql database: mysqli_query($con, "insert into medicacaohistorico (data, unidadeori, unidadedes, itemdetalhe, qtd, solicitante, despachante) values ('".date("y-m-d")."', '"....
asked by 08.08.2018 / 14:22
2
answers

With limiting the result of Select in Oracle

I'm doing a select from the bank and it's returning me 15 lines. I used ROWNUM to get the first 8 lines, but I want to make another select and pick up from line 9 to 15. SELECT * FROM (SELECT DISTINCT o.STORAGE_TYPE, COUNT(o.QUANTIDADE) as qt...
asked by 01.10.2018 / 16:35
1
answer

select distinct in temp table sql server

I have the following code: (it is from a table that the representatives have the same code, which generates duplicate values, I solve this by picking the most current representative, in short the last face that synchronized) / em> select dist...
asked by 04.10.2018 / 21:41
3
answers

Get last id or date inserted into a mysql table

I have a history of conversations that are registered in the table sql "conversation" and I want to pick who was the last person who inserted a message in the conversation to know if it was the user who wrote last or if it was the admin (id 28)...
asked by 24.05.2018 / 16:19
1
answer

MySQL compare a number with string returns true if string starts with number

I have the following table in the database: idUser - Username - Group 1 - John - 5GR 2 - Doe - 1GR And the following query: SELECT * FROM 'table' WHERE 'idUser' = '$name' OR 'Group = '$name' $ name is the variable that conta...
asked by 24.05.2018 / 11:18
1
answer

Group sum by month and year

I have a simple table in a FIREBIRD database: idCliente: integer dataPagamento: date valor: numeric How to make a select that adds up all the amounts to be paid by grouping by month and year? type like this: select MES_ANO, sum...
asked by 11.06.2018 / 21:48
1
answer

Select from all users with only one result of each user [duplicate]

Hello, good evening. I think the title is a bit confusing, I'll try to explain it better. I'm doing a chat system and I'm wanting to list all user conversations, but only one message from each user. Example: Itisshowingallmessagesfromth...
asked by 23.04.2018 / 06:31