EN VI
Posts (0)

No data results!

Please check back again in feature!

Questions (39)
2022-12-03 00:46:54
You can run command:docker cp {file.sql} {id image}:/{file.sql}open mysql cli and run this command:mysql -u{your_username} -p{your_password} {your_database_name} < {file.sql}
Tags: MySQL docker database
2024-03-10 22:30:05
You can't use arbitrary statements in the THEN part of a MERGE, the syntax is quite specific about what you are allowed to do. If you want to THROW on such rows then just use a IF EXISTS... WHERE NOT...
Tags: sql sql-server t-sql
2024-03-11 09:00:07
The problem is that you have a self-referencing foreign key, which is preventing you deleting this row because there are child rows dependent on it. The UPDATE statement isn't helping as that will onl...
Tags: c# sql sql-server
2024-03-11 15:00:08
You can try to use indexOf keyword. SELECT name FROM table WHERE id IN (5, 3, 7, 8, 11, 14, 54) ORDER BY indexOf([5, 3, 7, 8, 11, 14, 54], id); This gives you the result in the order specified in the...
Tags: sql database clickhouse
2024-03-11 22:00:08
Please note that the invoice_date is in varchar. I intentionally did that. Please don't store your dates as text. And if you must do that, you should at least store in YYYY-MM-DD iso format so that...
Tags: sql mysql-workbench
2024-03-11 22:30:09
So, let's create the schema: create table mytable(col1 text, col2 text); insert into mytable(col1, col2) values ('some_string', '{key1:0, key2:1, key3:0}'), ('some_string', '{key1:0, key2:0, key3:0}'...
Tags: sql string postgresql
2024-03-12 04:00:03
SELECT state, percent_alcohol_impaired FROM playground.bad_drivers WHERE percent_alcohol_impaired > 1.2 * (SELECT AVG(percent_alcohol_impaired) FROM playground.bad_drivers) LIMIT 100; You should...
Tags: sql subquery average
2024-03-12 08:00:04
Something like this mayhaps: DECLARE @cols AS NVARCHAR(MAX), @cols2 NVARCHAR(MAX), @sql AS NVARCHAR(MAX); SELECT * INTO #data FROM ( VALUES (1, N'A', N'H', N'J') , (2, N'B', N'I', N...
Tags: sql sql-server pivot
2024-03-12 12:00:08
I have a query where I am checking for the first instance of a status. Seems like you're checking for the latest instance of a status. It seems like the problem statement can be simplified to: Find...
Tags: sql sql-server
2024-03-12 14:30:06
We can take a union of the two tables and then aggregate by name: SELECT name, id, GROUP_CONCAT(course) AS courses -- see note below FROM ( SELECT name, id, course FROM TableA UNION ALL S...
Tags: sql sql-server

Login


Forgot Your Password?

Create Account


Lost your password? Please enter your email address. You will receive a link to create a new password.

Reset Password

Back to login