Questions tagged as 'select'

2
answers

Select to know customers without service in the last 30 days plsql

I have the following columns: CODCLI, CLIENT AND DTULTCOMP I need to know the customers who have not bought in the last 30 days. the DTULTCOMP column is in DATE format Table: PCLIENT     
asked by 28.06.2018 / 16:52
1
answer

How to perform this Select?

I need to relate data according to the last item found in the user table, for example: Table_A: +----------------+-------------+ | user_id | title_id | +----------------+-------------+ | 154138746 | 123 | +-----------...
asked by 15.07.2018 / 19:05
1
answer

How to count how many fields are empty in the mysql table

I have a land register table with several columns (some of them: id, address, city, proposal, etc.) and would like to count how many fields are empty. For example, the table has a total of 44 columns, if you only have 20 fields filled in, the...
asked by 16.07.2018 / 16:31
1
answer

ORDER BY or LIMIT. What is first processed in SQL Select?

Friends, what is first processed in SQL Select? The "Order by" or "Limit"? For example, if I have a table with multi-state cities. Then I look for cities with more than 100 thousand inhabitants of state X, resulting in 6 cities (eg cities lis...
asked by 07.06.2018 / 09:27
1
answer

How to give select in XML and return a specific column from an anonymous block?

I have an anonymous PL / SQL block that returns an XML to me as the result of running a web service. How do I give a select in this XML to get only one column I want?    Anonymous block: DECLARE l_filename varchar2(255); l_BLOB BLOB; l_CLO...
asked by 07.05.2018 / 20:18
3
answers

How to select only the largest move in Sql?

I'm in need of some help finding the latest inventory of each product. It turns out that in the clause I made, it is returning all the sales related to that product, being that I only need the last one ... The sales are ordered by id. I've made...
asked by 23.03.2018 / 16:37
2
answers

T SQL Merge Two Lines in One

I have an id in common (103307) and would like to join two rows in one. From image 1 and leave as image 2. Is it possible?     
asked by 22.12.2017 / 21:38
3
answers

How to check if a select is null

People, I have this code that pulls server info try { $conecta = new PDO("mysql:host=$servidor;dbname=$banco", $usuario, $senha); $consulta = $conecta->prepare('SELECT * FROM tb02_cardapiosem WHERE tb02_diasemana=' . $data); $c...
asked by 12.10.2017 / 15:00
1
answer

Perform calculation in SQL command

I made a select command on my table estoque where I bring the supply model , your current quantity and what your quantity minima in the inventory, for this I made query as follows: SELECT codigosuprimento, suprimento,...
asked by 13.10.2017 / 16:02
1
answer

Using the Select plugin 2 - How to disable select click

My page: <!DOCTYPE html> <html> <head> <title></title> <!-- 3 coisas para o plugin funcionar --> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstr...
asked by 05.12.2017 / 19:09