Skip to content
Advertisement

Tag: mysql

set decimal places of sum in sql

I have a database I use for a debating competition I am trying to sort the standings out to see which schools will play off in the finals at the end of the semester. I have this working as shown below however I am not able to round the ptc field, it currently returns up to 4 decimal places eg

ERROR 1062 (23000): Duplicate entry ‘2147483647’ for key ‘PRIMARY’

I have a table: As we can see, the previous value, just went wrong into table. Should be 16 numbers and not only 10, actually different numbers. When i try to insert a new value: I get this error: ERROR 1062 (23000): Duplicate entry ‘2147483647’ for key ‘PRIMARY’ If bank_card is AUTO_INCREMENT why there is error? Should I change the

MySQL Query selection

I have a big database table called pricing. The fields are following: id code description rrp buy stock date distributor vendor version User select the vendor field only. version field can be vary …

Select by -3 days?

I’m trying to select data from a specific table in my database, but I want to be able to only view the last 3 days worth of data, I have the following code but for some reason I can’t get it to work. Answer You may avoid usage of DATE_ADD() at all: As @OGHaza mentioned, you specified column with alias

PHP SQL Views counter using PDO prepare()

I have a variable $id which gives me the id of the current article and this can help me to make an update query in my database on current article. This is my code: I don’t get any errors but my code is still not working… Answer Your correct code is here: ; from the end of sql is not

Advertisement