Questions tagged as 'sql'

2
answers

Python prefix in string

I made a script to download an attachment from an email, this attachment is an XML file, and I want to save it to a database. But when I get the body of the XML, it comes with the prefix 'b' and therefore the error when saving the XML in the dat...
asked by 09.04.2018 / 20:49
3
answers

Avoid duplicate records in a given MySQL column [duplicate]

I have an auction system where multiple users can bid, but I'm having a problem when bids occur at the same time because they are inserted into the database with the same value in column bidding_price , eg:    0.02   0.02   0.02...
asked by 15.04.2018 / 21:07
1
answer

How to give count to a limited value, "count up to 90 in a table that has 100"

I have set the following Query - "INFORMIX" SELECT COUNT(1) FROM (SELECT * FROM NOTA_FISCAL_NFE LIMIT 90); That returns me the following error:    An error occurred when executing the SQL command: SELECT COUNT (1) FROM   (SELECT * FROM N...
asked by 13.04.2018 / 16:29
2
answers

How to get data from 3 tables with INNER JOIN in a performatic way

I have three tables in the database, which are Training, Exercise and Exercise_Training . I need to make SELECT with INNER JOIN and differentiate columns with the same name: SELECT t.id AS tid, et.id AS etid, e.id as eid,...
asked by 27.10.2017 / 06:46
2
answers

How to make something expire after certain months in db?

I want to add a "license" to a purchase in my database, plus that license that my "customer" will buy will have an expiration time, let's say he bought a license ... INSERT INTO compras (userid, pluginid) VALUES ('$userid', '$pluginid');...
asked by 01.06.2016 / 20:15
3
answers

PHP- Mysql Returning error: Call to undefined function [closed]

Good evening, I'm trying to make a connection to the database. And mysql is returning the following error.:    Call to undefined function mysql_connect_db () Follow my code: <?PHP // $servidor ='localhost'; $usuario ='root'; $senha...
asked by 03.06.2016 / 02:54
3
answers

SQL to load only part of a string [closed]

I would like some help. I have the following query below, however, I need in the column DE to bring only the texts after the word "Exclusion", and in column PARA only bring the text from the word "Inclusion". However, today, he is bringing the w...
asked by 01.08.2018 / 16:59
2
answers

Do a "Update" with a sum of a number that is as a character

I need to do a% with_quality with sum in a table whose column is of type update . Example: UPDATE produto SET codigo = 'codigo'+ 1; I have the following return: UPDATE produto SET codigo = 'codigo'+ 1; ERROR: invalid input syntax f...
asked by 27.07.2018 / 16:06
1
answer

Make Query with a given date - PHP

Hello, I have an order inquiries, where I just wanted to show the orders for the current day and also the next day's orders, where the next day's orders would only appear the ones that would have to be delivered at 8am.     
asked by 03.03.2017 / 13:01
2
answers

How to remove the decimal separator from a result?

In the sql query I have a total order value multiplied by 1000: Total value: 195.41 Value Viewed: 195410.00 How can I remove the tab? SELECT CAST (CONVERT (varchar, CAST (AS money 195410.00, 0) AS varchar)     
asked by 29.12.2016 / 14:01