From this AWS link it explains how to add a linked server: https://aws.amazon.com/blogs/database/implement-linked-servers-with-amazon-rds-for-microsoft-sql-server/ Specifically these commands The main problem is it seems to be a mix of ‘, `, and ” I get syntax errors, and I assume that’s why…
SQL agent job creation error: Job ‘XXX’ is already targeted at server ‘YYY’
I am trying to create and SQL agent job on SQL Server 2016. Here is the use of sp_add_job. EXEC @ReturnCode = msdb.dbo.sp_add_job @job_name=N’TEST_RUN_A_JOB_STEP’, @enabled=1, @…
AWS Athena: Unsupported correlated subquery type but it works on Mysql and other flavors
For each order in orders table, I’m trying to return the latest order update value based on time_sent, grouped into a single row. The above select query works fine in MySql but not in AWS Athena. Working MySQL example below: https://dbfiddle.uk/?rdbms=mysql_8.0&fiddle=66f17cf9f3c8f19f758c7cb1381d820…
how to merge multiple rows into single in MSSQL
this is my data: id segment country product status month year 83916512 Government Null Null Null Null 2014 83916512 Null Germany Null Null Null 2014 83916512 Null Null Carretera Null Null 2014 83916512 Null Null Null completed Null 2014 83916512 Null Null Null Null June 2014 83916512 Null Null Null Null Null …
how i get my 2nd id in the join table in mysql
SELECT package.pkg_name, pkg.cat_id,pkg.id FROM pkg INNER JOIN package ON pkg.id=package.id join categories ON pkg.cat_id=1=categories.cat_id=1 1st id is show in join table but 2nd id does not show …
REGEXP to identify and replace an email
long story short, I need to identify an email that may have 2 different endings: “HREmail@companyabc.com” “HREmail@company.com” I need to replace instances of the two above …
SQL SERVER Replace Null
I have a tsql query like that: DECLARE @TABLE TABLE( id int primary key identity(1,1), code int ); INSERT INTO @TABLE VALUES (1),(NULL),(NULL),(NULL),(2),(NULL),(NULL),(NULL),(3),(NULL),(NULL)…
Get Max from a joined table
I write this script in SQL server And I want get the food name with the Max of order count From this Joined Table . I can get Max value correct but when I add FoodName is select It give me an error. …
Mysql IF statement Error on Nested if sentence
I am trying to create a procedure to update the stopTime field on my works table. The query I am using is: update mydb.works set stopTime= (IF((SELECT table_name FROM information_schema.tables …
Display the data that does not exist in particular table using multiple interconnecting table join
I am trying to list all students that did not enroll in this subject yet using the var_subjectcode as filter. I am using the code below but it is not working properly. It keeps on resulting empty …