Questions tagged as 'sql'

2
answers

Problem adding SUM () in query

I have this Query SQL but when wanting to add a SUM to the column CANT_DISPONIBLE generates me an error, this is my Query select EB.ARTICULO,EB.BODEGA,EB.CANT_DISPONIBLE,EB.CANT_RESERVADA ,EB.CANT_TRANSITO,EB.CANT_REMITIDA,SUM(EB...
asked by 16.05.2016 / 20:42
2
answers

Format Date in MySQL

My problem is that I want to add a date column in this format 2016-08-13 Exactly in this Order I achieve this: DATE_FORMAT(NOW(),'%y-%m-%d') but now I need the same format but adding 30 days something like that but I have no idea DATE_FO...
asked by 14.08.2016 / 01:14
2
answers

Several Primary Key in SQLite3

Hello, I want a table in SQLite that has 2 fields as primary key and also a field% co_of% that is unique integer. What I've been looking for is something like this: create table t (id integer, name string, phone string, nick string PRIMARY KEY...
asked by 11.08.2016 / 20:44
2
answers

Search through a query

I am doing a search engine for my application, it is a search form that handles two parameters: by Route and by Product, but the user can place a parameter or can place both in the search, my problem is that if the user selects one parameter, th...
asked by 13.12.2016 / 02:52
1
answer

how to do a SQL query from different tables?

Good morning, I hope you can help me. I need to make the following query: Obtain the full name of the employees, as well as the name of the department, position and salary in which I have worked. I have the first query that is the following:...
asked by 28.11.2018 / 02:57
2
answers

How to make Select option save the entire string of characters and not just the first word?

I use this code <select name="escuelaprocedencia" class="form-control"> <option value="">- Selecciona -</option> <?php $conn = mysql_connect("localhost","radx","sands"); mysql_select_db("softn_cms",$conn);...
asked by 28.11.2018 / 07:25
1
answer

Multiplication hours x number

I have the case of a time worked and his salary for hours. I need to calculate how much they have charged: SELECT '07:45'::time as horas_trabajadas, 8.45::numeric(18,2) as precio_hora, '07:45'::interval * 8.45 as total_dia H...
asked by 12.12.2018 / 12:44
1
answer

SQL Server query: How to get a single record, from an inner join

I have the following tables, I would like to obtain the result which I mention in the example. I hope you can guide me a little. Thanks. Tabla: TR | idt | vt | ------------- | 1 | 1101 | | 2 | 1102 | | 3 | 1103 | ------------- Tabla TE...
asked by 23.11.2018 / 20:43
1
answer

sql use cursor to perform an operation between two tables

I have been asked to create a trigger which realizes an update of the balance field of the loan table, which is calculated by adding all the payments made in the column amount in the payment tablePrestamos, so I must do an update of all the Loan...
asked by 27.11.2018 / 08:16
1
answer

Problem with class extends in PHP

I have a problem with a class, in which I extend the Conn class which is my database connection. The error is    Class 'Conn' not found in ... <?php class User extends Conn{ private $nombre; private $username; public fun...
asked by 25.11.2018 / 15:30