Questions tagged as 'sql'

1
answer

SQL query error in PHP

I came across a sql error, but when I run the query in SQL Server Studio it returns the normal query. Query that is below. SELECT CAST(REPLACE(CAST(DsXML as Nvarchar(Max)),' xmlns="http://www.portalfiscal.inf.br/nfe"','') as xml).value('(/nfeP...
asked by 08.08.2017 / 15:09
1
answer

Error - Query: The subquery returned more than 1 value

I'm new to SQL and I have the following error in my query: "The subquery returned more than 1 value. This is not allowed when the subquery follows a =,! =, & lt ;, < =, & gt ;, > = or when it is used as an expression ". The query is this:...
asked by 14.07.2017 / 14:16
1
answer

Convert a to_date sql to a date java

My problem is this, I have to grab SQL insert lines and check if the formats in the TO_DATE function in these inserts are valid with a java method. For a 'DD / MM / YYYY' format, SimpleDateFormat solves my problem, but sometimes an insert is req...
asked by 07.07.2017 / 02:12
1
answer

Select with several Left Joins

I made a LEFT JOIN considering as attributes ( CPF , TEL1 , TEL2 and TEL3 ). Why all these? Because the CPF field often returns zeroed on one of the bases, so I'm considering the phone fields as well. As...
asked by 06.07.2017 / 22:17
1
answer

How to give permissions to user groups in PostgreSQL?

*Allregistereduserswhoaremembersof"SITE ACCESS" will have the same permissions. I created a Group Roles in PostgreSQL called "ACCESS SITE" to put all users (Login Roles) of sites and systems that will have permissions to search, insert, upda...
asked by 07.07.2017 / 18:22
2
answers

Inquiry bringing duplicate items + product code

Hello, I am doing an SQL query on my Firebird server. I made the query using the following syntax: select ds_produto_servico, count(ds_produto_servico) from tb_produto_servico group by ds_produto_servico having count(ds_produto_servico) > 1...
asked by 07.07.2017 / 14:54
1
answer

Spinner.setadapter on a null object reference [closed]

The array of players is populated with data but gives error in method setadapter . Spinner spinnerJogador1; ArrayList<JogadorModel> jogadores = jogadorRepository.SelecionarDisponiveis(); dataAdapter = new ArrayAdapter(this,...
asked by 04.07.2017 / 11:57
2
answers

SQL query with list in WHERE

I have a query that searches all the id's for a DB. I make WHILE and put them in $retorno['dados'] . Since there is nothing separating them, they are all together. If I return the id's 41, 45, 50 , I get 414550 . Anyway,...
asked by 03.07.2017 / 07:30
1
answer

Concatenate an SQL value

I have a trigger that updates a particular raw table, but it replaces the existing quantity and I need it to concatenate the new value with the existing value, could someone help me how to do this? create trigger trg_atualizaEstmatprim after u...
asked by 01.07.2017 / 23:22
2
answers

How to select data for the month and previous year?

I'm trying to do a search from dates in MySql. I need to get the total sum of a value where the year and month are smaller than the ones reported in the variable: SELECT SUM(valor_pag) FROM controle WHERE MONTH(data_paga) < 07 and YEAR(d...
asked by 15.07.2017 / 23:27