Skip to content
Advertisement

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 products I made a subquery for this But it gives Error:

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:

how can i optimize this mysql statement, it is very slow

Answer This query is slow because it is actually 16 x 3 = 48 queries. You have 16 SELECT correlated subqueries in your main SELECT query, and you’re looking up three values of p._id. Your first step is to transform at least some of those subqueries into independent subqueries and JOIN them. (This is a vital skill for people who

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 at the last

Search a word inside post_content specifically on H1 tag [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 months ago. Improve this question As Title implies, Search the value inside the variable of $word inside the tag of column post_title content. The query should view the data of

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 enough permissions even though I am user server admin login. Is this because of Microsoft Azure database

Re: MySQL 8.0 Command Line Client Error 1205

MySQL 8.0 Command Line Client is giving me a timeout error and I have restarting the transaction by typing “start transaction” another time. Keep in mind that I have another command line open with the table CIA_DATA.new_table and it is also being updated with the same changes. (I am doing this to follow a tutorial.) Here is the script: Updated

Advertisement