Questions tagged as 'sql'

1
answer

Filter query by removing duplicates

Good afternoon, I have the following select : select codemp, codfunc, codevento , vlrevento from sankhya.TFPFOL where codemp = 1 and codfunc = 26 and month(referencia) = 1 and year(referencia) = 2009 group by codemp, codfunc, codevent...
asked by 21.12.2018 / 17:34
1
answer

SQL SCRIPT WITH ERROR

For the sake of curiosity I got a story from my second half of ADS and this is a SQL script based on 3 tables: ALUNO , CLASSE , MATRICULA . I made the script according to the statement, but my script does not execute, the fo...
asked by 21.12.2018 / 14:21
1
answer

How to return what the customer bought / paid for?

I have the following tables: using JOIN CREATE TABLE tbCliente ( ClienteID INT IDENTITY(1,1) PRIMARY KEY, ClienteNome VARCHAR(50), ClienteTelefone VARCHAR(15), ClienteDataCadastro DATE) CREATE TABLE tbPagamento ( PagamentoID INT IDENT...
asked by 07.12.2018 / 22:52
1
answer

update with auto relationship

I have a table called Category, in it I have the attributes ID, DESCRICAO e ORIGEM , I needed to include another attribute ID_CATEGORIA_PAI , this attribute is an autorelacionamento with the same table. Now I need to get some tuples...
asked by 12.12.2018 / 12:22
1
answer

How do I transform some rows into columns?

I have this database with questions and answers Youneedtocreateaviewthatthequestionsandanswersgetarrangedthatway.. A friend spoke of such a pivot but I can not make it work     
asked by 06.08.2018 / 05:51
2
answers

SQL Connection with PHP does not find the Drivers

I have the following PHP: <?php class Conexao { private static $connection; private function __construct(){} public static function getConnection() { $pdoConfig = DB_DRIVER . ":". "Server=" . DB_HOST . ";"; $pdoC...
asked by 19.07.2018 / 20:45
2
answers

Query Syntax Error with RFID Code Filter

You're giving Syntax SQL error in from estoque where cod_rfid = 102 . Note: 102 is the value that is in the RFID tag. String dadoRFID = new String(readBuffer); String Del_inc = dadoRFID.substring(0,1); //Pega o primeiro caractere...
asked by 06.11.2018 / 02:24
2
answers

Error writing date converted to phpMyAdmin database

I'm trying to write a form to the database, in that form there's a date field that contains dd/mm/aaaa mask. To write to the bank I need to convert that date to aaaa-mm-dd , until then I got str_replace , the problem is that w...
asked by 07.11.2018 / 14:17
1
answer

How to format a number in percentage within JavaScript?

Gentlemen, I'm developing a billing monitoring dashboard. I want to turn this number 56% directly into my JavaScript code. Here is a snippet of my code, it is fed directly by a query from my SQL. This is the query that feeds my field within J...
asked by 27.07.2018 / 22:12
1
answer

Search for NULL mysql via Java

I want to write a resident in my database via java when one of the searched parameters is NULL , but it turns out I can not figure out how to pass this command. My code is: public Usuario registraSaida(String nome) throws SQLException...
asked by 05.06.2018 / 05:48