Linked Questions
80 questions linked to/from MySQL - UPDATE query based on SELECT Query
5 votes
1 answer
29k views
"from" is not valid at this position, expecting: EOF, ";" [duplicate]
I try to increase John Smith salary by 10% and assume I don't know the emp_number for John Smith. update m set m.mon_hourly_pay_rate = m.mon_hourly_pay_rate*1.1 from monthly_pay m inner join ...
4 votes
1 answer
1k views
how to update a field in mysql pdo from another table [duplicate]
This is not a duplicate question. The previous question is nothing to do with PDO. I have two tables in mysql: USERS ------------------------------------- employeeid | name | saving | salary --------...
-1 votes
1 answer
591 views
How to update SQL with single query and not with php loop? [duplicate]
These are my tables: tbl_answers => aid qid answer uid dateposted emailnotify namedisplay status isbestanswer tbl_questions => qid question ...
0 votes
2 answers
325 views
Mysql Update using value from select [duplicate]
I have a weather app, and I'm storing meteo data every hour in a database. Recently i discovered a tiny bug which lead to the writing of few hundreds faulty records. To fix the issue i decided to ...
0 votes
2 answers
171 views
SQL syntax error : 'FROM table_A INNER JOIN table_B ON table_A.name = table_B.name' at line 1 [duplicate]
I've got an error saying that" You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM table_A INNER JOIN table_B ON ...
0 votes
0 answers
144 views
Update table with select results in MYSQL [duplicate]
I am currently doing some exercises to better understand how to use MYSQL. I am trying to update a table that from the select results from two other tables. The general idea is to have the table ...
0 votes
0 answers
19 views
Copy mysql db field to another field [duplicate]
I have a database table with thousands of products. Each product have various fields. There is a field (field1) on each product that contain a link, I need that link to be copied to another product ...
5 votes
4 answers
10k views
update row if count(*) > n
my DB has this structure: ID | text | time | valid This is my current code. I'm trying to find a way to do this as one query. rows = select * from table where ID=x order by time desc; n=0; foreach ...
2 votes
1 answer
12k views
MySQL: How to fill new column of existing table with value based on select from another table [closed]
My knowledge of SQL trully isn't so great to perform what I want. I have 2 tables: One is long data table with many columns, one of them TypeName, recently I've added new column to the table TypeID (...
6 votes
3 answers
2k views
Increment File Name Before Extension By 1 in the Database
I have a script which uploads a file and stores the details of the file name in the database. When a document gets uploaded I want to be able to update the name of the file in the database to be ...
2 votes
1 answer
11k views
Apply styles on Picker items in Xamarin Forms
I have a Picker, i want to apply different styles to all the items, also prefer if could do for IOS and Android at the same time. in custom.xaml: <ContentPage.Content> <StackLayout&...
1 vote
1 answer
18k views
Trying to use DATEADD and getting function does not exist error
I have the table TableName which contains approximately 5,000 rows. It consists of a product_id and a ScheduleTime. What I want to do with this table is replace each value of ScheduleTime, ...
5 votes
1 answer
10k views
How to update millions of rows quickly in mysql
I need to update over 4 million rows in my database. We are currently using mysql 5.1 and the updates are very slow. At the moment it is taking over 30 minutes for less than 100,000 rows, which is ...
0 votes
3 answers
7k views
MySQL update the same table based on results of a select
I have a table called downloads which has records of files which have been downloaded from various URL's. There is a column downloads.created which is a DATETIME and a column downloads.master which is ...
1 vote
1 answer
4k views
sequelize updating multiple rows
Update multiple rows , is using a bulk update a good solution or something like the code below works ? . I supposed wanted to update all the records with the id and filename. I did try to update ...