All Questions
1,359 questions
-2
votes
1
answer
54
views
UNDO in SQL workbench
i run a query to update the data the query gone wrong and data is updated not as per my desired output.
Now i want to get that previous data back.
what should i do?
I tried ROLLBACK function it didn't ...
0
votes
1
answer
71
views
How can I find the longest number of consecutive nulls in a column in MySQL?
Supposing I have a table consisting of something like:
date | A | B | C |
02/01/2020 | 3 | 5 | null |
03/01/2020 | 8 | 3 | null |
04/01/2020 | 3 | 4 | null |
05/01/2020 | 5 | 9 | 3 |
06/01/...
0
votes
1
answer
233
views
MySQL Permissioning a User to CREATE/LOAD/UPDATE temporary tables?
I have a user that I have already permission to be able to CREATE a temporary table, however when she tries to load a csv file into that temporary table, we're getting a restricted access error for ...
0
votes
0
answers
31
views
How to fix 'This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' [duplicate]
This is my query:
select
product_category,
product_sub_category
from prod_dimen
where prod_id in
(select prod_id
from market_fact_full
group by prod_id
order by count(prod_id) desc
...
1
vote
1
answer
69
views
How do I remove the Default Schema in a recursive query?
I'm trying to run this 'WITH' query on MySQL Workbench:
WITH countUp AS (SELECT 1 as N
UNION ALL
SELECT n+1 FROM countUp WHERE n < 3)
SELECT * from countUp;
This recursive ...
0
votes
0
answers
19
views
Statement incomplete in mysql [duplicate]
Im having trouble creating a function in mySql where it is throwing errors.
-- Function to calculate due date --
create function calc_due_date(checkout_date datetime)
returns datetime
begin
...
0
votes
0
answers
62
views
Whenever I try to run a sql script, I get stuck
When I try to restore Mysql databases, during the part where you run the script, workbench gets stuck and won't proceed
Mysql version 5.5
workbench version 6.3 CE
sql file size 4360 mb
Whenever this ...
1
vote
0
answers
38
views
How do I make the 1:n relantions using SQL in MySQL Workbench?
I'm brand new to SQL and mySQL workbench. I'm trying to get the one to many relantionship from team_id to home_id and the one to many relantionship from team_name to visitor_id. I cannot get the ...
-1
votes
2
answers
59
views
Creating a Auto Generation ID with Prefix in MySQL Without Using Trigger
Creating a Auto Generation ID with Prefix in MySQL Without Using Trigger
I need Creating a Employee Id with Prefix and Without Using Trigger in MySQL.
0
votes
1
answer
44
views
DECLARE is not valid at this position expecting END (TRIGGER)
I am trying to create a trigger to capitalise the first letter of the first name and surname in the customer name column.
However receiving an error on the declare section:
DECLARE IS NOT VALID AT ...
0
votes
0
answers
30
views
Comparing Queries which having two different results that aren't far apart
$sql = "SELECT Status FROM citydoc2023.status WHERE EmailNotifierFlag = 1";
$record = $database->query($sql);
$statuses = '';
while ($data = $database->...
0
votes
0
answers
80
views
SQL - Problem with a query for stock to date
The image below illustrates the schema of my query. I would like to obtain the stock of marbles that I have when I am a park (park 1 or park 6) on a given date.
@date = '2023-12-20'
table ...
0
votes
2
answers
2k
views
Copy a table from one database to another database table
I have a MySQL database named wc_players in which it has a table called players_wc. I want to copy the entire table to another database named as fifa which already has a table named fifa_wc. How can i ...
1
vote
1
answer
48
views
How To Update a Table with several changes in values with a LOAD csv file?
I have an existing Stores_Master table, with existing columns and values like, Storenumber (Primary Key), Store_Name, Location, inactive_flag, and Region_Number. Over time this table has developed ...
0
votes
1
answer
57
views
"Comparing Rows in MySQL between two tables
"I have two tables, 'announcement' and 'temp_announcement.' The 'announcement' table contains 15 rows, while the 'temp_announcement' table contains 21 rows. I need to compare the rows between ...