Questions tagged as 'sql'

1
answer

Expiring user usage time Mysql

I'm doing a C # sign-in system where the user is logged in to verify their login, password and how much time they have left to use the system. Even the part of checking login and password I managed to do, but I'm having trouble checking the usag...
asked by 24.02.2017 / 13:25
1
answer

Date in postgresql.PL/SQL

With the function below I want to make this function compare the current date with the date stored in the database. create table mercado( id integer, diaEntrega date, valor integer ); insert into mercado values (2,'7-02-18',1...
asked by 17.02.2017 / 17:59
1
answer

SQL with PHP - Problem in SELECT

I have an album, so I click on the album, it's just to show the photos that are in the database with the id of the selected album, I click on the album and the photos from the album with the selected id and the id of the album are coming. anothe...
asked by 20.02.2017 / 16:34
1
answer

Select - Time comparison does not work

I'm trying to make a query to eliminate results in which the end time of the event is equal to 00:00:00, I made the query this way: select nome, local, hora_inicio, hora_fim, data_inicio, data_fim from agenda where hora_fim <> 00:00:00;...
asked by 21.02.2017 / 19:48
1
answer

How to return values from different columns without repeating? [closed]

I'm trying to capture and print all the categories in a table, but I do not want them to repeat themselves. Notice that there are 4 columns of different categories below: NUMEROID-----NOME-----CATEGORIA1-----CATEGORIA2-----CATEGORIA3-----CATEG...
asked by 01.02.2017 / 03:25
1
answer

Reducing quantities of rows in a query

On my system I have 3 tables: -Table Movie - A movie featuring multiple artists -Tabela Artist -Table Participates Movie - This table contains the ID's of the movie and artist table. Then when I want to select a movie with all your a...
asked by 04.03.2017 / 14:38
1
answer

Advanced SQL Query with dates

I've had a problem for days. I have my table and need to count how many grades are late, so long. I just do not know how to do this query. I need to check if they are late, to be late it has to be with a difference of 3 days from the current dat...
asked by 17.01.2017 / 12:05
1
answer

INSERT in two Tables based on SELECT

Imagine the following scenario: At some point you need to duplicate people and their items. If I have the following data: Person Table +----+------------+ | Id | Nome | +----+------------+ | 1 | Joãozinho | | 2 | Mar...
asked by 02.03.2017 / 20:27
1
answer

Search for string in SQL / PHP database

Good evening, I have the following select that is to search for users according to their category: $consulta = "SELECT * FROM app_usuarios WHERE cat = '$categ' $ categ is the variable that I get dynamically according to the user's choic...
asked by 23.01.2017 / 22:06
1
answer

Scheduling System Windows, SQL

How do I make create and run a sql (postgresql) command in the windows scheduling system? My problem. I have a postgresql database where I have two tables. One is a client and the other is a disk location. I need to know if the location...
asked by 15.02.2017 / 15:38