Questions tagged as 'sql-select'

0
answers

How to leave the required selection? and also by default the first available option?

I have a system in php that generates selects according to the information of the database, in case I would like to leave these selects obligatory because they do not go unnoticed and also always leave the first option selected as the default....
asked by 25.05.2018 / 20:50
0
answers

Query schedule in sql

I have the following problem, I will receive a bank with "x" available positions in several specialties and another with "y" patients requesting those specialties follows the model of the tables below, would have to elaborate a query that would...
asked by 13.05.2018 / 00:08
1
answer

Create query to return the lowest possible value

Good evening. I need to do a sales report grouped by period and by card. But I do not know how I can enter a store and horizontally it appears the values of each card. Example of what the output should look like: Loja01, with 03 sales (100 visa,...
asked by 05.02.2018 / 23:49
3
answers

Get the same result as a query with join

I have already researched some forums, looked at my books and searched other sources, but I did not find anything that solved my problem. I have a query that queries the open value in a given table: select negociacao_parcela.data_pagamento,...
asked by 22.01.2018 / 20:41
1
answer

How to return only unmatched records in a JOIN? [duplicate]

I have a question regarding the use of JOIN in SQL in this case: I have a produtos table and a destaques table that contains the id of the product. I need to make a query that returns only the records that are n...
asked by 17.10.2016 / 00:50
1
answer

Prevent duplicate records in left outer join

I have tried to use distinct but without success ... result should be SELECT distinct prd.ID_CPF_EMPRESA, prd.prd_codigo , prd.cat_codigo , prd.prd_descricao, prd.prd_preco , prd.prd_img , prd.prd_det_1 , prd.prd_det_2 , prd.prd_ativo , IFNULL...
asked by 31.10.2017 / 19:26
1
answer

Select with averages in minutes - Mysql

Below is a query returned in a table from my database (MySQL): WhatinterestsmearetheTimeString,VarValue,andidcolumns.Every5secondsonaverageaninsertismadetomysystem.IhaveDateTimevaluesof1month.Doubt:HowdoIsetupqueriesthatreturnmeatintervalsof...
asked by 01.11.2017 / 12:25
3
answers

No select error using mysqli_query

I've done a php to list the rooms, but I'm having difficulty listing them, if anyone can help me, I would appreciate it. <?php $link = mysqli_connect("localhost","root","","hotel"); $result = mysqli_query("SELECT descricao FROM quartos WHER...
asked by 08.06.2015 / 21:53
3
answers

No select error using mysqli_query

I've done a php to list the rooms, but I'm having difficulty listing them, if anyone can help me, I would appreciate it. <?php $link = mysqli_connect("localhost","root","","hotel"); $result = mysqli_query("SELECT descricao FROM quartos WHER...
asked by 08.06.2015 / 21:53
3
answers

No select error using mysqli_query

I've done a php to list the rooms, but I'm having difficulty listing them, if anyone can help me, I would appreciate it. <?php $link = mysqli_connect("localhost","root","","hotel"); $result = mysqli_query("SELECT descricao FROM quartos WHER...
asked by 08.06.2015 / 21:53