Closed

Convert MSSQL Query To MYSQL Query

Greetings - I am in need of converting thes mss sql server query to mysql. Whop can achieve thes or me? SET @v_start_date = '20190101';

SET @v_number_of_months = 12;

WITH

cte_input_values AS (

/* insure @start_date is the first day of the month */

SELECT CAST(TIMESTAMPADD(MONTH, TIMESTAMPDIFF(MONTH, 0, @v_start_date), 0) AS date) AS start_date

),

cte_tally10 AS (

SELECT * FROM (VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0)) AS numbers(number)

),

cte_tally100 AS (

SELECT ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) - 1 AS month_number

FROM cte_tally10 c1

CROSS JOIN cte_tally10 c2

),

cte_months_to_pull AS (

SELECT TIMESTAMPADD(MONTH, t.month_number, start_date) AS month_to_pull

FROM cte_tally100 t

CROSS JOIN cte_input_values

WHERE t.month_number BETWEEN 0 AND @v_number_of_months - 1

UNION ALL

SELECT TIMESTAMPADD(MONTH, t.month_number, TIMESTAMPADD(YEAR, -1, start_date)) AS month_to_pull

FROM cte_tally100 t

CROSS JOIN cte_input_values

WHERE t.month_number BETWEEN 0 AND @v_number_of_months - 1

)

SELECT

INSERT(DATE_FORMAT (month_to_pull, 7), 4, 4, '') AS month_year,

IFNULL([login to view URL], 0) AS total_sales

FROM cte_months_to_pull

LEFT OUTER JOIN (

SELECT TIMESTAMPADD(MONTH, TIMESTAMPDIFF(MONTH, 0, SaleDate), 0) AS SaleMonth,

SUM(SaleAmount) AS SaleAmount

FROM CurrentYear

CROSS JOIN cte_input_values

WHERE SaleDate >= start_date AND

SaleDate < TIMESTAMPADD(MONTH, @v_number_of_months, start_date)

GROUP BY TIMESTAMPADD(MONTH, TIMESTAMPDIFF(MONTH, 0, SaleDate), 0)

UNION ALL

SELECT TIMESTAMPADD(MONTH, TIMESTAMPDIFF(MONTH, 0, SaleDate), 0) AS SaleMonth,

SUM(SaleAmount) AS SaleAmount

FROM PrevYear

CROSS JOIN cte_input_values

WHERE SaleDate >= TIMESTAMPADD(YEAR, -1, start_date) AND

SaleDate < TIMESTAMPADD(MONTH, @v_number_of_months, TIMESTAMPADD(YEAR, -1, start_date))

GROUP BY TIMESTAMPADD(MONTH, TIMESTAMPDIFF(MONTH, 0, SaleDate), 0)

) AS YRS ON SaleMonth = month_to_pull

ORDER BY MONTH(month_to_pull), YEAR(month_to_pull)

Skills: MySQL, SQL, Microsoft SQL Server, Database Administration

See more: convert mssql queries mysql synatax, convert mssql file mysql syntax, convert mssql backup file mysql, convert mssql syntaxis mysql, convert mssql syntax mysql, mysql query convert string md5 hash, convert mssql mysql freelance, convert mssql asp mysql php, convert mssql bak file mysql, convert xml files mysql query, convert mssql query mysql, convert mssql query mysql query

About the Employer:
( 0 reviews ) Athens, United States

Project ID: #20707638

20 freelancers are bidding on average $27 for this job

WebExpert555

Hi. Dear I am very interesting your project. I have rich experience mssqt2mysql query. Pls feel free discuss more detail via chat. Kind regards!

$30 USD in 7 days
(9 Reviews)
4.7
dungforever

Hello mate I am very glad to place a bid to your project I have read your description carefully and i am so interested in your project. I am skillful Software developer and i have finished a lot of project of these fie More

$50 USD in 1 day
(13 Reviews)
4.5
durgesh8527

Hello Sir/Mam, I have read your post requirement for the " need of converting thes mss sql server query to mysql. Whop can achieve thes or me? SET @v_start_date = '20190101';". Now I have some questions to clear the t More

$50 USD in 4 days
(12 Reviews)
4.4
sreenivas2903

HI I am expertise in sql queries. and also experienced in both mssql and mysql. if you are interested ping me we will work on it.

$55 USD in 7 days
(17 Reviews)
4.3
ihshsl

change YDM it will be alright..............................................................................

$20 USD in 1 day
(9 Reviews)
3.9
coderjp

I've been writing MySQL for 7 years and MS SQL for 2. I can convert these for you by tomorrow. If you can send me a SQL dump of your DB structure, I will test them before sending them on too.

$25 USD in 1 day
(4 Reviews)
3.7
Shreehari369

±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± MSSQL TO MYSQL ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± Hello Sir! I think I'm a great fit for this project because I have that capability that can be hel More

$30 USD in 1 day
(4 Reviews)
3.5
solomonsameer

Hello There, I can convert MS SQL query to MY SQL. I am all st to start work on your project Lets discuss and finalize. Regards Sameer Solomon

$30 USD in 1 day
(3 Reviews)
3.5
JennyHazard

Dear sir. I ve studied above code. It's easy, I will support you, and check result . I think we have to discuss in more detail ASAP. I will wait for your reply. Best regards.

$20 USD in 7 days
(5 Reviews)
2.9
SashaMorozov

Dear sir. I have just read your requirements carefully. I am very interested in your project. Although I am new in freelancer, I have more than 5 years of experiences in Database Administration. I'm an expert in MySQL More

$20 USD in 1 day
(3 Reviews)
2.6
hengzhulu

hi, I have experience in job like this and I can do this job very fast. As a best DBA, I have 6+ years of experience with System Speed Tuning, Database Optimization, Big-Data Manipulation and so on. I am waiting for yo More

$19 USD in 7 days
(1 Review)
0.6
ugunaymetu

I can help you with this task as I have 12+ years of experience with Sql Server. Please contact with me for details.

$29 USD in 1 day
(0 Reviews)
0.0
ravikirankhandre

I am database developer with strong knowledge Oracle and SQL. I have 5+ years of experience IT experience. I can make it to meet all your expectations.

$15 USD in 1 day
(0 Reviews)
0.0
janglia510

Hello, I have read your project details carefully. I am interest in your project. Because I am sql expert. I like to help someone. If you start with me, I think I will give you the perfect result you want. I am one of More

$10 USD in 7 days
(0 Reviews)
0.0
Saimi786

Hello Thanks for your posting. I am a senior developer so i can do it very easily if you want.I’ve read your job description carefully and I am very interested in your project. I am sure that I can finish this project More

$19 USD in 7 days
(0 Reviews)
0.0
Filiumenterprise

Dear Sir, Read your requirements, and our skills match the required implementation. We are a fast- growing company, and have well- trained resources available to initiate your project immediately. Below, are a few int More

$30 USD in 10 days
(0 Reviews)
0.0
AFBB

Hello! I'm a computer scientist for 5 years now. I have experience of mssql and mysql. So, I think I can get the job done for you. I'm looking forward to hearing from you again.

$20 USD in 1 day
(0 Reviews)
0.0
mjomba

I am a database developer and have lots of knowledge on both languages

$25 USD in 25 days
(0 Reviews)
0.0
Shanikhan5

Hi there, good to see you. i completely read your requirements and i can build this. this is a simple to convert MSSQL Query to MYSQL Query as you will require. Lets start chat for further discussion. Regards Zees More

$30 USD in 1 day
(0 Reviews)
0.0
manojmo

Hi, I have 20+ years of experience, mostly on java, web, and database technologies. I have also worked on PHP, Python, spark, some ML, and dabbled in many others. My linkedin profile : [login to view URL] More

$15 USD in 1 day
(0 Reviews)
0.0