Questions tagged as 'sql'

2
answers

How to get records for the last 15 days - PostgreSQL

I have a table called Entrega where all the deliveries made with their respective dates are stored, how can I only deliver deliveries from the last 15 days? Doing so I can deliver from 10 October, for example: SELECT * FROM public.entre...
asked by 13.10.2017 / 16:46
1
answer

Pick up all product category levels

I have a question. I have a table of categories: CREATE TABLE 'categorias' ( 'id' int(10) UNSIGNED NOT NULL, 'parent_id' int(10) DEFAULT NULL, 'lft' int(10) DEFAULT NULL, 'rght' int(10) DEFAULT NULL, 'nome' varchar(255) DEFAULT NULL,...
asked by 10.05.2017 / 20:35
2
answers

How do Postgres create a file to populate a bank?

I have a database in POSTGRESQL populated, wanted to know if a command exists SQL that returns a string that has the following command for all existing tables: INSERT INTO aluno(id , nome, idade ) values(1,'Raul',23) I wanted to do this...
asked by 15.05.2017 / 14:46
2
answers

How to request day data in SQL with Unix Time Stamp (PHP)

Hi, I'm having one with a question here, I'm creating a code to get how many users logged into my site today, but I saved the last date it logged with Unix Time Stamp. I'm just getting the users who logged in the last 24 hours, but what I wan...
asked by 07.01.2018 / 17:17
1
answer

How to join records from a table distributed in multiple .sqlite files?

I have several files with .sqlite extension, each containing at least 1000 records totaling about 4,000 records. See how they are distributed: vihicles1.sqlite vihicles2.sqlite vihicles3.sqlite vihicles4.sqlite Inside each fi...
asked by 20.02.2017 / 17:44
2
answers

How do I get all the data in a table based on another table?

I have a countries table and another table with continents that has FK as the id of the countries table and I needed to return all the countries in Europe. Can anyone give a help on how to do this? Thank you in advance. This is the structure...
asked by 20.10.2015 / 15:39
1
answer

Return an PDO query in an array

How do I make a query with PDO and return the results in a array . Ex: I need to make a query that returns 10 rows, each row has 3 columns <?php $equipe1 = $_POST['equipe1'];//Pega o Nome da equipe $equipe2 = $_POST ['equip...
asked by 21.01.2017 / 01:23
1
answer

What is the difference between the various types of SQL JOIN? [duplicate]

In SQL there are several types of JOIN , what is the difference between INNER JOIN , LEFT JOIN , CROSS JOIN , RIGHT JOIN and FULL JOIN ?     
asked by 20.09.2016 / 03:25
2
answers

Error in CRUD command UPDATE - java.sql.SQLException: No value specified for parameter 8

I'm building a Java system with MySQL database connection, but I stopped at some point because I can not find the error. My update method happens an error in JUnit, but I can not figure out what it is. Follows parts of the code: package com...
asked by 17.12.2016 / 20:36
2
answers

SQL query for Linq mvc4 c #

I'm not very familiar with Linq and I'm having trouble turning this SQL query into linq, can anyone help me. I do join of 6 tables (I did not do the database. I have to work with it), what I'm hooked on is group by and having...
asked by 18.11.2016 / 12:29