Questions tagged as 'sql'

1
answer

Repeat the field value of an SQL query

I'm doing a query in SQL and with the following need in the table I have the document in two moments or status (1) when it originates and (2) when it is "linked to another process" the point is that when I generate the query only the records of...
asked by 09.03.2018 / 00:27
2
answers

Bidirectional trigger

I have to make two triggers, one that, after inserting into test1, insert into test2. So far so good, the problem I have is that I should do the same in the inverse case. When there is an insert in test2, I must do the same insert in test1. I un...
asked by 05.06.2017 / 11:32
1
answer

Error with extra attribute when grouping items by categories

I have the following tables: categories |------|--------| | id | name | |------|--------| | 1 | c1 | |------|--------| | 2 | c2 | |------|--------| | 3 | c3 | |------|--------| items...
asked by 06.03.2018 / 01:22
0
answers

compare current field with the following to perform a subquery in MYSQL

I have a query, in it, I have a subquery, and I only want to execute the subquery always when the current code field does not repeat with the next. I will show a sql pseudocode so that I understand what I want to do, especially in the CASE:...
asked by 30.07.2018 / 05:34
2
answers

how to select data between a range

As I can build the SELECT, to select from a table the data that are in the middle of a sequence, I need to select from the column code, the data in the sequence are between the smallest code, ie 001, and the last Bone 005, knowing that 005 could...
asked by 29.07.2018 / 01:32
1
answer

Get a certain day of the week between a range of dates in SQL [closed]

How to Get the dates of a certain day of the week between two dates. Example: All the dates of the Monday days between the range of 2016-01-19 to 2016-02-19 Reputed: 2016-01-23 2016-01-30 2016-02-06 2016-02-13 This is what I am doing but I am...
asked by 19.01.2017 / 16:47
1
answer

Stored procedure invoking dll

I have to create a stored procedure that receives one parameter and returns another. Within the procedure I declare a variable and give it value with a select. Later with the input variable and the one obtained from the select I invoke a dll. I...
asked by 22.11.2016 / 11:55
2
answers

Problem when rating object-table when doing a SELECT on Oracle

I have a problem with the following query : SELECT USER ,TO_CHAR(LAST_LOGIN, 'DD/MM/YYYY') LAST_LOGIN ,SAILA ,MAX(INTENTS) INTENTS ,MAQ FROM OWNER.MY_TABLE_NAME WHERE LAST_LOGIN >= TO_DATE('22/02/2017' || ' 00:00:00', 'dd/m...
asked by 23.02.2017 / 00:31
2
answers

Display query result differently SQL

I have the following query: SELECT pr_products.product AS PRODUCT, pr_varieties.variety AS VARIETY, pr_grades.GRADE, SUM(pf_harvest.quantity) AS QUANTITY FROM pf_harvest INNER JOIN pf_performance ON pf_performance.id = pf_harvest.id_performanc...
asked by 29.03.2017 / 22:17
2
answers

Count positions of an SQL field

How do I manage to count each position in this array? I was working with SQL queries what happens is that I can not get the positions .     
asked by 22.12.2016 / 22:37