Tag: mysql

Unable to filter by calculated datetime when pulling data from MySQL into MS SQL

I’m connecting from MS SQL Server 2014 to a (ServiceNow) MySQL database via OpenQuery(). I would like to filter out records more than 24 hours old. When I set a static date, it returns the thousands of rows I expect to see. However, when I try to use a calculated field, it runs but returns […]

Symfony rank mysql database

I am actually having loads of trouble trying to obtain the rank or position of a specific row on Symfony. Example: player table id – name – total 1 xxxx 100 2 yyyy 200 3 www 500 When I do the following thing on the terminal, it works fine: SELECT id, total, name, @curRank := […]

How to dynamically select suffix values from a column value using a table of selection values

Primary issue: I can’t re-create two MySQL statements into MS Sql – because MS SQL for instance does not cast a value like ‘1g’ into an integer value of 1 although MySQL seems to with the MySql statements I’ve created. My Situation: I have a data column from a table that contains a mix of […]

Joining two tables with reference to foreign key

I have some problems with joining two tables when foreign key is no set directly. I have two tables: TABLE A {A.ID} {A.NAME} {Parentid} {A_FK} (foreign key) A.ID1 A.NAME1 NULL A_FK1 A.ID2 A.NAME2 NULL A_FK2 A.ID3 A.NAME3 A.ID2 NULL A.ID4 A.NAME4 NULL A.FK4 OtherA OtherId Other Other Table B {B.ID} {B.Code} A.FK1 some_text1 A.FK2 some_text2 […]

SQL how to compare two columns from two different tables

I have two tables, in which table 1 contains 4 columns while table 2 contains 8 columns. I have two columns in table1 that I want to compare them with two columns in table2. Table 1 have column1 and column2 (that needs to be compared) Table 2 have column6 and column7 (that needs to be […]

How to copy and move a database from MySQL to MSSQL and vice versa using Python 3?

I’m creating a Python application that could copy and move a database from MySQL to MSSQL and vice versa. I’m done with its GUI and my only problem is the function for Copy and Move. Is there a library or code that I could use in Python 3 to make this possible? For example: ——————– […]

Is there any difference between SQL Sever Compact Edition and SQL Server Express Edition?

I have created a database for Windows Form Application in SQL Server Express Edition 2012. Can I install SQL Server Compact Edition at client side to use this database for my project?

Implement C# migration code in SQL

I am new to SQL and today I got assigned an important task – to create a migration script for data in a table. From my understanding, a migration script is copying data from table A and move it to other tables B and C and so on. This seems to be frequent when database […]

Error Encountered with AS

I got issue on this query kindly assist. i was trying to change the null value to 0 but when I try to run this query it encountered syntax error with AS : select CAST(COALESCE(STATUS AS NVARCHAR(5))) from dbo.amb_cancel_master

Rails SQL Query returning count = 0 as count = 1

I have the following SQL SELECT distinct loan_cases.case_status, count(loan_applications.id) FROM “loan_cases” LEFT JOIN case_statuses ON loan_cases.id = case_statuses.loan_case_id LEFT JOIN loan_applications ON case_statuses.loan_application_id = loan_applications.id GROUP BY loan_cases.case_status; This is my result set case_status | count ——————————+——- Completed (End) | 28 Need Special Attention | 0 Failed (End) | 11209 Pending Submission | 1720 Pending […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.