Skip to content

Tag: mysql

Error => #1242 – Subquery returns more than 1 row

I am selecting order data from my orders table with that I also need the order product’s count which contains a specific word Account TopUp 200, Account TopUp 500, Account TopUp 1000, The order contain multiple product means one order contains both(Account TopUp 200, Account TopUp 500) and other product…

MySQL Where condition with CASE

Here i want like if cksp.status is not null then condition should be cksp.is_include_in_pipeline = 1 ELSE ignore the where condition Answer That logic should be similar to:

SQL: Help creating a table based on another tables value

I am new to SQL and am currently doing a project on MSQL 2019. I have one table with a list of codes mapping a “Loss ID” to a Reason. Now I have another table that just gives you the number of the Loss ID but not the text version of it. How can I create a table that will

SQL divide count grouped by the same value from different columns

So I have a table with two rows containing names and some other stuff, these two columns can contain the same name: Buyer Seller RegionID … John Lina 1 Lina Kajsa 2 John Conny 5 Kajsa Conny 3 John Erik 2 Kajsa Conny 1 John Conny 2 John John 1 John Conny 1 Kajsa David 1 David David 1 Lets

Mysql query for getting today’s data in a sub-query #mysql

I have to get today’s data in MySQL query. In this query, it shows the error message that we can select one column which is understandable as I have used (col1, col2(for date)) as col. but I need a solution to get this done. thanks Answer If you need today’s data only, You should use the condition…

Microsoft Azure database admin user creation

I deployed azure MySQL 5.7 database in azure. I can’t create another admin user with admin permission with the serveradmin login. When I tried below command GRANT ALL PRIVILEGES ON . TO ‘sammy’@’localhost’ WITH GRANT OPTION; I am getting error serveradmin@ip don’t have enou…