Questions tagged as 'sql'

1
answer

manipulating dates in postgresql

I have a database with multiple records, from 2001 to 2010 . How do I select all tuples with dates after day 2001-05-02 ? Date is of type character varying(254) .     
asked by 25.05.2016 / 20:37
1
answer

SQL Server SQL query with COUNT and INNER JOIN

I have a page in PHP where I have to return data from two tables that are in a SQL Server database. One of the banks is from registered sellers and the other is from the categories where they are registered. I need to make a comparison and...
asked by 14.04.2016 / 20:43
1
answer

Foreign key SQL SET NULL

Good people, let's go to one more question, I hope you can help me. I have the following problem: When I create a foreign key linking to another field in another table I always define it as CASCADE . But when I enter a field (say in thi...
asked by 08.04.2016 / 03:40
1
answer

Column type for support table

I have a client table and would like to create a support table to avoid creating many columns (address, phone, telephone1, email, email1, email2, car nameplate, mother name, etc.). The support table consists of the customer code, field and va...
asked by 05.04.2016 / 19:58
1
answer

Database - list table [closed]

How can I list all the DB table and put it in a table, list or any corner of the page?     
asked by 06.06.2016 / 13:46
1
answer

DOUBT INTO A SELECT - SQL

I have basically this relationships: Iwouldliketogetthevalueofthe"im_fab_model" attribute of the "tblPrinter" table from the code of the "is_cod_printer" attribute of the table "tblPrinterPrinter", can anyone help me? For now I have this sel...
asked by 09.07.2016 / 20:53
1
answer

SUM within SUM Entity Framework perfomance

I've done a query with entity framework and I'm having performance issues. public static Decimal ValorPrevisto(this ClinicaModel clinica) { return clinica.Contratos.Sum(c => c.Mensalidades.Where(m => m.Pagamento != n...
asked by 18.03.2016 / 04:22
2
answers

MySQL, selecting 4 related tables [closed]

I'm trying to do a select in 4 different tables. All are related. It all starts with ID_Morador . SELECT morador.* ,unidades.* ,grupo.* ,condominios.* FROM morador LEFT JOIN unidades ON id_morador = morador.id_uni...
asked by 18.12.2015 / 14:11
2
answers

Compare two fields between different tables

I have a big problem. It is the following I have the Script below: <?php $contarperfilclientecontar = "0"; $sqlxml = "SELECT id ,vvenda FROM imoveis WHERE cod = '1042' AND status = '2...
asked by 08.03.2016 / 11:58
1
answer

How to find Null values without specifying attribute (MariaDB)

I would like to do a search to find NULL values across the table without having to determine which of the attributes might have NULL. NOTE: with ALL the table I mean that somewhere in it has null, not that the table should be composed entirel...
asked by 04.07.2016 / 00:00