Questions tagged as 'sql'

2
answers

Concatenate SQL Server

I have the following query: SELECT UPPER(admatribuido) AS [admAtribuido], Count(admatribuido) AS [quantidade_admAtribuido] FROM ##tmp WHERE Month(dataabertura) = Month(Getdate()) AND Year(dataabertura) = Year(Ge...
asked by 18.01.2018 / 16:40
3
answers

How to select the year in PLSQL?

I have a table of data for company officials. I have to show who completed a year of work at the company. The data type for the yearAdmission field: DATE (dd / mm / yy)     
asked by 07.02.2018 / 21:28
3
answers

make a grouping select per year

I have a client field in it I need to make a count of how many customers were registered during the years 2016, 2017 and 2018. I was doing 3 select, and in each one I made a where dataCadastro > = 2016-01-01 and dataCadastro
asked by 31.01.2018 / 16:10
3
answers

How to store static information without using a database?

How do I store static information without using the database? For example, let's say that I have a text on a page that does not need to change frequently, and to avoid using server resources and / or to load the page faster and also with edit...
asked by 19.06.2016 / 15:40
1
answer

Group by with error in SQL Server

Good morning, I would like to know why my SQL query is not working, I'm using SQL Server 2008 and my GROUP BY is going wrong. I already checked and the table names are correct and are filled correctly. Code: SELECT categoria, nome_ca...
asked by 07.06.2016 / 14:45
1
answer

Use a sql.Connection class for each task or only one referenced globally? [closed]

I have a class that is responsible for checking the user's account and password when logging in, and in the future I will have to implement another class to get other data in the bank and create a new connection. Would it be a good idea to us...
asked by 07.11.2016 / 02:30
1
answer

Query returning unwanted result

In my sql statement: SELECT DISTINCT C.TABLE_NAME,C.CONSTRAINT_NAME,C.COLUMN_NAME FROM INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE C INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS T ON T.TABLE_NAME = C.TABLE_NAME WHERE C.TABLE_NAME = 'VALOR_...
asked by 04.11.2016 / 18:33
1
answer

Error creating a simple table in Oracle SQL Developer

I'm having trouble creating the following table: CREATE TABLE T_AM_OME_ADVOGADO ( cd_pessoa NUMBER (8) NOT NULL , nr_oab NUMBER (8) NOT NULL , nr_cpf NUMBER (11) NOT NULL , nr_rg CHAR (10) NOT NULL , ds_email VARCHAR2 (128...
asked by 18.08.2016 / 21:18
3
answers

Select different values in two tables - SQL and PHP

I have two tables in the tt_order and the request_grade , what I want to do is compare the values in the " request " column of the table and the column " n_pedido " of the request_grade, basically I would like to get the values you have in th...
asked by 22.11.2017 / 17:02
1
answer

Order by with union

I have the following tables: Pessoa1 Id | Nome | Cidade 1 | José |São Paulo 2 | Maria |Rio de Janeiro Pessoa2 Id | Nome | Cidade 1 | Pedro |Belo Horizonte 2 | Ana |Vitória I have...
asked by 08.09.2015 / 14:02