Questions tagged as 'sql'

4
answers

Build database

I need to build a database with 200 rows and 4 columns (with the 4 variables I designed). I devised a study to estimate the presence of snakes in a particular city, I have no data. I thought the presence of snakes was due to these 4 variables: P...
asked by 09.10.2017 / 21:51
3
answers

Count of filtered dates per day in MySQL

I am a beginner in MySQL and have registered a table in PhpMyAdmin , where id is int , and all other fields are text , including data_cadastro field. I was in doubt, because there were several types of fields with...
asked by 16.11.2015 / 18:53
2
answers

Convert data to dd / MM / yyyy ORACLE

How to format sysdate for dd / MM / yyyy in Oracle 11g?     
asked by 21.08.2015 / 03:07
3
answers

Loop output within another loop with SQL and PHP

I have these values in my SQL database, I want an output this way and this file in the browser using PHP Database structure with the values I want on the output My attempts, although it does not help you at all: pastebin.com/6tCNbpY4 DA...
asked by 26.05.2014 / 18:41
3
answers

With LEFT JOIN list the NOT IN

In Mysql I have the table usuario , with the fields ID and CPF : IreceivedalistofsomeCPFsfromtheclientandwhatIneed:SeewhichoftheseusersisNOTintheusuario_gerenciamentotable,theproblemisthattheusuario_gerenciamentotabledoesn...
asked by 06.12.2018 / 13:48
3
answers

Column outside the WHERE condition of SELECT

I need to make a query that returns a column with the amount of requests the customer made within the period spent in WHERE and together with another column with the total number of requests that the customer has made so far. More or less like t...
asked by 18.12.2014 / 19:11
2
answers

Select with INNER JOIN, bringing fields that have foreign key NULL

I have a table of items, request_itens, interested (it has auto relationship, it is used for secretary, sector and employee, and a requested table), in the order table I have 3 foreign keys (one for secretariat, another for sector and one more f...
asked by 27.05.2016 / 23:21
1
answer

Catch only first word inside a sql server query

Good afternoon, I have the following query SELECT COUNT (SolID) as quant, UsuNome as gerador FROM Solicitacao INNER JOIN Usuario ON Solicitacao.UsuIDAtendenteViaFone = Usuario.UsuID WHERE UsuIDGrupo = 2655 AND DATEPART(m, SolData) = DATEPART...
asked by 03.11.2015 / 19:50
3
answers

Data types in SQL Server 2012 and HTML forms with PHP: date and monetary values

How can I put a mask in an HTML form in the date and monetary value fields, then send that data to the database without having to convert the strings to types date and money ? I explain: I have a form with date mask in DD/M...
asked by 08.12.2015 / 10:54
2
answers

Check UNIQUE element before inserting it

I have a table in a MySQL database where one of your fields (email) is UNIQUE , when inserting a record I must first make a select checking if there is a record whose email field match the email I want to insert (remembering that th...
asked by 13.04.2015 / 19:09