Questions tagged as 'sql'

1
answer

Best way to generate Holerite, I look for a more viable solution

I developed an application that generates Holerites, and for that I need to treat data coming from 4 tables.    Officials - > Companies - > Maturities - > Discounts I want to show my user this way for example:    Rafael works...
asked by 04.01.2018 / 19:45
2
answers

Convert Varchar to Time in SQL with data longer than 24 hours

I am developing a query in SQL and in case I need to convert a field of hours that is in varchar to time and then make a media of this field (I will use Datediff together). The problem is that CONVERT only does the conversion to data until 23:59...
asked by 05.01.2018 / 03:14
1
answer

Is it possible to compare schema between different banks in SQL Server?

I have several different BDs, and I need to compare their Schemas, but doing this manually can go unnoticed. For context I will use database of lesser proportion than I work. Image here . As you can see in the image, I have two databases, th...
asked by 07.12.2017 / 15:03
1
answer

ORDER BY in string date

I have a table in the database, novidades , where I have a column named date is to be stored as string in dd-mm-yyyy format, but I would like to sort by date based on this value , I calculate that you have to convert to da...
asked by 27.11.2017 / 14:32
1
answer

Problem with RAND in SQL

I'm using MySQL "5.6.38-log - MySQL Community Server (GPL)" I have a procedure that runs every second, and it has a validation with a RAND: WHERE t.auc_due_time < GREATEST(LEAST(TRUNCATE(12 * RAND(),0),12),2) The problem I am facing i...
asked by 28.11.2017 / 00:46
1
answer

How to avoid performance problems with tables that contain lots of data?

I'm developing a payroll system, in which there is a 'problem' in one of your tables. For, to control the discounts in the pay of each employee, I thought of creating a table with the name: Discounts that would have the fields, such as: id,...
asked by 28.11.2017 / 15:54
2
answers

Select on the bank using "like"

I'm trying to make a select in the mysql database, but I'd like to use like , which should get the value of a java variable. How can I make this interaction? public void returInfoClient(userClient) { Connection mConn = (new Connecti...
asked by 21.11.2017 / 11:45
1
answer

Insert SQLite using an array - PHP / Laravel

I have the following array : array:30 [▼ 0 => "12933" 1 => "12931" 2 => "12930" 3 => "12929" 4 => "12928" 5 => "12927" 6 => "12926" 7 => "12925" 8 => "12924" 9 => "12923" 10 => "1292...
asked by 15.11.2017 / 17:46
2
answers

Difficulty in recovering BRANCH information given a PRODUCT, many-to-many relationship

I recently started my studies in the area and I have a difficulty in the code. I need to display the data as follows: Product code Product class Product Description Name of the branch where you have the product Availability (if it...
asked by 22.11.2017 / 00:24
1
answer

A SELECT that pulls rows from a column (string; string)

> Example, in a certain column I have the values: 1) (joana; carla; josefa) 2) (gabriela; maria; julia) 3) (maria; carol; jaqueline) SELECT needs to return the lines of 2 and 3 that have "maria" I need to do a php f...
asked by 02.11.2017 / 04:28