Skip to content
Advertisement

Tag: mysql

Why doesn’t SET and CONVERT work for updating a table in MYSQL

I have the following code, with the column SaleDate in a datetime format, and I am trying to update it in the table to a date datatype instead and I’ve tried both cast and convert, but neither modifies the table, does anyone know what’s wrong? Answer You need to ALTER the table structure for that: This will try to convert

savepoint in sql

Can I rollback to a savepoint ( which was done before a commit ) in SQL ? Answer You can use the ROLLBACK TO SAVEPOINT statement only in the transaction. In MySQL documentation (https://dev.mysql.com/doc/refman/8.0/en/savepoint.html) you find: All savepoints of the current transaction are deleted if you execute a COMMIT, or a ROLLBACK that does not name a savepoint. So the

Bigquery – How to filter records with certain condition

I’m trying to write SQL (in BigQuery) the following in order to get a result that satisfies the following conditions. for ex: my table contains the following data I want to filter out records where it contains only value as “p” from the table. The expected result would be I have tried with the following query but it returns other

SQL – updating column based on next row value

I have a table, and the requirement is to update column ‘val’ based on the value in the column ‘val’ in next row (ordered by by id). Table is shown below : I’m able get the select query to get the next value, however the update query is not working. Here is the select query (working fine): Here is the

Can I connect a openCart project with mobile app? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year. Improve this question my English doesn’t well, I am sorry I have a open Cart project this project have own database, and I have mobile app for the same

How do I reset a MySQL column in a table every year?

I have a column named lv_casual in a table called tbl_employees. I need to reset the column to 0 at a specific date every year. Answer You can use MySQL event schedule. Providing an example below. You have to enable the schedular first Then create the event Check MySQL document for creating event

MySQL Joining multiple tables with where clause result is too slow

Let’s say I have the following structure of tables; and I want a result of; So I used the following query; I still have other tables that are connected to table1. The problem is the result is too slow even though there are only three results. I’m not that good at databases maybe I’m doing it wrong. Answer First of

Advertisement