Questions tagged as 'sql'

1
answer

How to save a common table expressions (CTE) to a variable in sql

Hello, I'm trying to save the value of a common table expressions (CTE) in a declared variable. This is all I have. DECLARE @valor decimal(12,0) with xc as ( select v.productoid, p.nombre, eq.unidadid,...
asked by 30.08.2018 / 19:45
1
answer

When creating a temporary table in MySQL and assigning data from another table is it necessary to specify the data types?

I have a question, I am using the following query: Create temporary table tbl as Select * from bd.tbl2 where date < '2018-09-08' The issue is that I still do not understand if when creating a temporary table and assigning data from another...
asked by 08.09.2018 / 17:15
1
answer

Duplicate automated log SQL server

I have the following problem: In the BDD I have records of thousands of products with the invoice date and the amount that was sold. What I need is to add records for all the product codes that I have registered, taking all the dates from the...
asked by 27.08.2018 / 21:19
1
answer

Use of IN and OUT in Stored Procedures

A procedure stored as such is a routine that contains the sql statement (s) to which it is accessed as follows CALL nombrePA(); A simple example we have of a PA is like the following DELIMITER // CREATE PROCEDURE fetchAll() SELEC...
asked by 10.11.2018 / 01:49
2
answers

How to show a row of a table first?

Having this table as I would do so that row number 3 appears first in a query and the rest is like this .. but in the query all records appear, just vary the order I would like the result of the consultation to be something like this...
asked by 11.11.2018 / 20:36
2
answers

The SQL query returns 0 data

I am trying to make a report but it does not filter me correctly, by using the LIKE statement even with the characters ( "% text%" ) or the equality of where clienteT='text' but in other cases if it works. the first query does...
asked by 09.08.2018 / 18:56
2
answers

I must make a query to a code but in the BD is the code with zeros on the left

Example I must consult this code 2365 but in the BD is this 00000002365 how can I make the query just by writing the code 2365 without the zeros? I am working on visual studio 2015 with BD Oracle. "SELECT * FROM MOVIMIENTOCONTABLE WHERE CTE...
asked by 09.08.2018 / 22:46
1
answer

Help with a transaction with dapper

Hi, I'm doing a transaction using dapper, but the detail is that when the error is marked. I reverse the changes with the rollback, but when I try a second execution. it tells me that the conectionString is empty. using (var cn = VariablesGl...
asked by 31.07.2018 / 21:29
1
answer

Modify from DataGridView connected to SQL in C #

Good morning, I am developing an application using Windows Forms within C #, it is a record of workers in a store, the users are entered from a form inside the application and they are shown in the following module in a DataGridView which is...
asked by 23.08.2018 / 16:39
2
answers

Error in SQL statement in access

Could someone please tell me what is the error in this sentence or what is missing? select count(distinct BLART) from COV_SAP_AccP_LA where Country = "XXX" I'm doing it in access and what I want is for you to tell me separately the...
asked by 10.08.2018 / 14:41