Questions tagged as 'query'

1
answer

Sql query return same name with different date

My table Acidente looks something like this: Vitima - DataRegistro Pedro - 10/02/2015 Pedro - 20/03/2015 Maria - 01/05/2015 Maria - 01/05/2015 I need to make a query (Sql) that returns the records that contain: Victim's name...
asked by 22.06.2015 / 03:41
1
answer

SQL query grouping by age group

Hello, I need a way to do an sql query that will bring me the amount of male and female people. NOTE: I have two tables where the first one is registered in it I have the sex column and another table that would be entered only with the addressna...
asked by 02.09.2015 / 15:56
1
answer

Order by SQL Server in Procedure

Hello, I am in the following situation: I need to select the amount of care of people of some age groups and of those who are male and female. I have the following tables: cadastro (id, natendimento, data, sexo, fokfaixaetaria) and fa...
asked by 02.09.2015 / 21:31
1
answer

Receiving and manipulating data from a query

I'd like to know how to manipulate the data of a query . I have a method that performs a Select , and I'm creating a List to store the results, and returning that list. But how can I use this data outside the method? Foll...
asked by 24.12.2018 / 14:07
4
answers

Filter using only month and year in SQLSERVER

I need to mount a select, in which the filter is used only the month and year in the parameters. This is the select I'm currently using, but I need the 'day' not to influence my search. SELECT NOME_CLIENTE, COUNT(NUMERO_BILHETE) AS...
asked by 03.01.2019 / 14:45
2
answers

Object attributes coming null in Query

Would anyone know to tell me why in my query, the attributes of the COR object, are coming null? I make that same query for Sizes, and it brings me the result waiting. but when doing the same query, for the class Color, it finds the objects, how...
asked by 09.11.2018 / 06:34
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

Query Oracle SQL - Subtract hours

Hello, I am a beginner in SQL and I have a mortal doubt. This query is to parse a running log on a basis of my company. The problem is that the OS time zone is +0.00 which creates incorrect logs in my log (you can not make this change, so I've a...
asked by 08.08.2018 / 21:46
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