Questions tagged as 'sql'

1
answer

SELECT on a parent table where ALL children are in the same situation - MariaDB / MySQL

I need to make a select in a parent table, where all the children in this table NEED to be in the same situation. For example: In the parent table I have the following fields: pai_id, pai_nome In the child table I have the follo...
asked by 12.11.2017 / 02:33
1
answer

How to make an INNER JOIN with two tables in different banks?

I have two different banks that I make the connection in the following way: date_default_timezone_set('America/Sao_Paulo'); abstract class BancoDados { const host = 'localhost'; const novoweb = 'novoweb'; const WebAccount = 'Web_Account'; cons...
asked by 15.12.2017 / 17:27
1
answer

Does not return the number of records in the PostgreSQL database

I would like to know how many records in my database, but do not return the quantity. Look at the records in my database SQLcommandSelectcount(*)ascontaRegistrosfromtb_produtoswhereprod_nomelike'%"+ +"%'; Result     
asked by 30.10.2017 / 19:52
1
answer

How to conduct a double consultation on laravel?

I have a query in SQL Ansi: select * from payments as P, receipts as R where P.created_at < CURRENT_DATE AND P.updated_at < CURRENT_DATE AND R.created_at < CURRENT_DATE AND R.updated_at < CURRENT_DATE Precious to perform the sa...
asked by 24.10.2017 / 22:51
1
answer

Display BLOB text

I am having the following problem, in a precise report displaying a field of the request that is as BLOB. And when I run the search it returns a strange code instead of the field information. $sql = ibase_query("SELECT CAST(OBSERVACAO AS CHAR(...
asked by 30.10.2017 / 19:13
1
answer

SQL: Avoid repeating row and sum values

I have this select: select DISTINCT (clients.name) as nomeempresa, payments.amount_paid as pagamento, receipts.original_amount as recebimento FROM payments, receipts, receipt_status, payment_status, clients WHERE pay...
asked by 30.10.2017 / 17:48
1
answer

Clasture where in field type json no (Laravel + Eloquent)

The problem is the following, I have to bring from a select the permissions that a profile has, only the permissions are in a json field, and because if it is several permissions we have a data collection, I need to do this within a middleware:...
asked by 19.10.2017 / 23:28
1
answer

Read file exported from Microft SQL 2016

I received an exported Microsoft SQL 2016 file that has a .txt extension and the same file with .csv and looks like this: I searched, but I still have not found anything, does anyone have any experience in importing this file into R?...
asked by 17.10.2017 / 15:09
2
answers

Java / SQL Login and Password Validation Problem

I have a validation problem with Login and Password, the code is only taken from the values of the first row of the database, but when I try to put the values of the other lines it gives error, thank you if anyone can help me. Follow the code be...
asked by 17.10.2017 / 03:16
1
answer

Dropping the tables from my schema in Oracle

I am using a Schema in Oracle (sql developer) and within my schema there are already several tables created that I was using previously. Now running a new script in this scheme it has the following error: Relatório de erros - ORA-00955: nome j...
asked by 05.11.2017 / 02:37