Questions tagged [query]

Denotes the question related to database SQL query( in context of magento ).

Filter by
Sorted by
Tagged with
0 votes
0 answers
14 views

I have a custom search function that just started having a bit of an issue with caching (I'm assuming)

I'm not sure when it started not working or if it ever worked. Helping a friend out with their website. I'm going to assume it was working at some point. I looked in the logs while refreshing the page ...
Singleton's user avatar
0 votes
0 answers
34 views

How to sort products in Magento by new from date?

I wanted to sort products by new from date , please see the query but it is not working perfectly $collection->getSelect() ->joinLeft( ['catalog_product_entity_datetime' =>...
Mark's user avatar
  • 43
0 votes
0 answers
27 views

Getting this erorr You cannot define a correlation name 'news_from_date_table' more than once

When I am using above mentioned query then getting the error You cannot define a correlation name 'news_from_date_table' more than once $subquery = $collection->getConnection()->select() ...
Mark's user avatar
  • 43
0 votes
1 answer
107 views

Is it possible to get Country Name using Select Query in Magento 2 DB?

I am trying to get the list of customers from the database directly using Mysql Query. SELECT ce.email As Email, ce.firstname As Firstname, ce.lastname As Lastname, COALESCE(NULLIF(cae.country_id,''), ...
Chirag Prajapati's user avatar
1 vote
1 answer
142 views

magento 2 can anyone tell me how to get user permissions list from database . I need query for this .Please help me

Query to get user permissions list in magento2 Admin roles role_type table column I found related query in above link but permission column is missing . Permission column exists in authorization rule ...
sandhya S's user avatar
0 votes
0 answers
177 views

Magento 2: How to add filter in custom graphql?

I have created a module with graphql schema where I will get the custom collection. Now I need to add a filter based on a few fields so I referred to this blog but I need to use 2 fields in the filter ...
MagentoDev's user avatar
0 votes
1 answer
62 views

Magento 2 - Query to know the user who update the price of the product

I am very new to magento. What is the query to to know who was the user who updated the price of a product? I just want to know the query, not the code. Thanks in advance.
jsnewbie21's user avatar
0 votes
1 answer
37 views

What are the security risks associated with a Magento 2

What are the security risks associated with a Magento 2 website, and how can you mitigate them?
Noor Mohamed's user avatar
0 votes
2 answers
161 views

Magento 2 - Products in category page not showing

My problem is that : all products in category page not showing. And when i displayed the query of $_productColection in Magento_Catalog/templates/product/list.phtml : /** * Product list template * *...
Heri Rak's user avatar
1 vote
0 answers
76 views

Export products and additional attributes - SQL query for Magento 2

What would be the QUERY SQL to export the SKU columns and ADDITIONAL_ATTRIBUTES as shown in the product export module n Magento 2?
heroecall's user avatar
0 votes
1 answer
121 views

Add limit on collection of custom table and get one column value in Magento 2

I know there are solutions for getting one column as an array. $collection->getColumnValues('column_name'); And adding limit without setPageSize() and setCurPage() $collection->getSelect()-&...
Knight017's user avatar
  • 622
0 votes
1 answer
53 views

Display individual product video descriptions for multiple videos

I am trying to provide video transcripts for each product video in a magento 2 site. I want to pull the transcript from the "video description" field in the admin area, and I have been ...
kug3lblitz's user avatar
0 votes
0 answers
17 views

Get new instance of Magento\Framework\App\ResourceConnection or unset MappedTables before query

So I'm facing an error in my custom query. Multiple queries is being run to get category tree and for each category I'm mapping a table to temp table. example - // $this->resource is object of \...
Afreen Sheikh's user avatar
1 vote
2 answers
128 views

Slow Query on Magento 1.9 Front-End After Moving Site to a New Server

I've just moved a Magento 1.9 site using a tarball and a mysqldump of the old site to a new server having the same hardware specs as the old one, followed all instructions I could find online, saw ...
Reza Anwar's user avatar
1 vote
1 answer
554 views

Magento 2 - Best way to query data from tables (select with multiple joins)

I'm learning about Collections, Repositories and DTO, and I'm still trying to figure out what's the best way to query a table to fetch data. I also found that we can use \Magento\Framework\App\...
Douglas Vicentini's user avatar
1 vote
1 answer
245 views

Magento 2 Extremely high load on MySQL due to select query

I've seen similar questions asked on this site, but haven't seen a solution or fix to resolve the problem. Our site is spawning a large number of select queries to the point where mysql is overloaded ...
Mike C's user avatar
  • 11
1 vote
0 answers
128 views

Magento 2: How create ui grid filter for null values in specific column

I have a column "purchase_point" in my table. It has 3 values android, ios, and null. I need to display it in the ui grid. For the null value, I need to display 'web'. I am using the below ...
Alshihab's user avatar
  • 131
1 vote
1 answer
669 views

Magento 2 GraphQL Error: Undefined property: GraphQL\\Language\\AST\\FragmentSpreadNode::$selectionSet

I am working with magento 2.4.4-p1. I got an error on calling the below graphQL query on the site. query Route($url: String!) { route(url: $url) { redirect_code relative_url ...
Jancy Abraham's user avatar
1 vote
1 answer
952 views

Return custom db fields via graphql resolvers

I've added custom fields to sales_order Now I want to return them in customerOrders GraphQL query as a value from database. How can I do it without fetching the order from database again in Resolver ...
Herokiller's user avatar
0 votes
1 answer
713 views

How to find admin custom url in database core_config_data table using sql query in magento2

Run this command on SQLyog or other tools. Your Custom Url: http://localhost/magento2ProjectName/stage3fedex7id4w/ SELECT * FROM core_config_data WHERE PATH LIKE "%admin/url/%"; =============...
Vikram Dhande's user avatar
0 votes
1 answer
91 views

How to change filter "and" to "or"?

version : Magento 2.4 safira I want my website show every products related to filters I choose. If I choose multi filters, I only got products fulfilled all conditions. Is there any way I can edit ...
Ryung Kim's user avatar
0 votes
1 answer
53 views

how do I write a paremeterized delete query using json_extract?

I would like to write a query like delete from inventory_reservation where JSON_EXTRACT(metadata, '$.object_increment_id') = '<increment_id>' So I created my expression in my code like $...
gabtzi's user avatar
  • 636
0 votes
1 answer
128 views

How to log query for cart event?

I want to see the mysql query when adding a product to the cart. I have referred this link, How to log all Magento 2 SQL queries? but I need query only for cart. How to get the query for cart events? ...
MagentoDev's user avatar
0 votes
1 answer
1k views

MySQL query for list all the categories and its description from Magento 2 database?

How to get all the categories and its description from Magento 2 Database using MySQL Query ?
shankar boss's user avatar
  • 1,439
1 vote
2 answers
4k views

Magento 2 How to add custom product attribute into existing product graphql query

How to add custom product attribute into existing product graphql query in the custom module in Magento 2. THANKS.
Mohit Patel's user avatar
  • 3,681
3 votes
2 answers
6k views

Magento 2 How to create graphql query

How to create custom graphql query in custom module in magento 2. THANKS.
Mohit Patel's user avatar
  • 3,681
0 votes
3 answers
3k views

How to Print Raw SQL query of Magento 2 format?

I am trying to print the raw SQL query of the below statement in Magento2 but am not able to do it. please find the statement $connection = $this->getConnection(); // I am getting the connection $...
shankar boss's user avatar
  • 1,439
0 votes
1 answer
270 views

Does Magento execute a query to get the review count of each single product on the category listing page?

Let's say that your category page shows 36 products at a time and shows the rating/review count underneath each product title. Does Magento perform 36 queries to get each of the product's review ...
Timothy Fisher's user avatar
1 vote
0 answers
41 views

Executing direct query in Magento 2 issue

this is my code: $connection = $this->resourceConnection->getConnection(); $connection->query("SET @@group_concat_max_len = 1000000"); I have a query using a group concat. The ...
Attila Naghi's user avatar
  • 3,903
0 votes
2 answers
272 views

Strange search terms automatically added to Search Query table

Strange search terms appear in Last Search Terms and Top Search Terms which are from Search Query table. What can be the reason?
Reshad Zazai's user avatar
0 votes
1 answer
482 views

Get Latest Entry For Duplicate Rows In Collection

I currently have a logs table which has the following rows which use the same order_id: log_id order_id user action 2410 1001318004 test1 Declined 2409 1001318004 test1 Declined Inside my app/code/...
SNAFU's user avatar
  • 176
0 votes
2 answers
133 views

How to remove pending reviews directly in database

How can I remove all pending reviews in certain store view directly from database? What should I use as SQL query?
Webninja's user avatar
  • 1,581
0 votes
1 answer
1k views

Magento 2 : row id and entity id not same in catalog_product_entity table

Executed query - SELECT GROUP_CONCAT(parent_id SEPARATOR ',') AS parent_id FROM catalog_product_super_link AS super_link WHERE super_link.product_id = 914066 The issue is there are records where &...
devhs's user avatar
  • 497
0 votes
1 answer
82 views

MySQL Query of catalog_product_super_link filtered by attribute_set_id

I want to export all fields from the catalog_product_super_link table, but filtered to exclude any products that have have a certain attribute_set (31 in this case). This post (MySQL Query filtered by ...
JoeT's user avatar
  • 1
0 votes
1 answer
191 views

How to set the conditions for displaying of the related-products

Overriding related-product collection. My aim is to set limit for related product display. Related-products are not displayed if there are less than 10 products, the maximum number of products that ...
David's user avatar
  • 21
0 votes
1 answer
398 views

Cron job to delete catalog_product_entity_datetime table data, am I using the correct interface?

I have a query to select data from catalog_product_entity_datetime table. can I use below interface to grab the data from above table? If can't what should I do to grab data from this table? I don't ...
Paul Fan's user avatar
  • 614
0 votes
2 answers
304 views

how to optimize queries in magento 1.9 with lots of attributes (over 500)

I have a website running Magento 1.9 which is flooding mysql with slow queries like this SELECT COUNT(DISTINCT e.entity_id) FROM `catalog_product_entity` AS `e` INNER JOIN `...
gabtzi's user avatar
  • 636
1 vote
1 answer
112 views

Magento2 - How do I write below query function into non-deprecated? without using getCollection()

How do I write below function into non-deprecated? In Magento2. without using getCollection() public function getNewCustomer() { $customerData = $this->customerFactory->create()->...
Paul Fan's user avatar
  • 614
0 votes
1 answer
388 views

How do I change this sql query to Magento2 filter collection method?

I have below query SELECT * FROM newsletter_subscriber WHERE change_status_at >= (NOW() - INTERVAL 10 DAY); How do I make it works with below? public function getSubscriberStatus() { ...
Paul Fan's user avatar
  • 614
0 votes
1 answer
151 views

I have no idea why my Subscriber Collection Factory is not working

I have no idea why my Subscriber Collection Factory is not working. Below is my code. Wish someone can help me to fix my problem. I believe something wrong with my setup of CollectionFactory use ...
Paul Fan's user avatar
  • 614
0 votes
3 answers
273 views

I have below sql query, how do I turn this to Magento get data method to retrieve data?

I have below sql query, how do I turn this to Magento get data method (collection?) to retrieve data (not using ObjectManager)? Please help. public function getNewCustomer() { $objectManager = \...
Paul Fan's user avatar
  • 614
0 votes
4 answers
880 views

how to use date() in magento query?

I want to filter some orders based on the date range so in SQL i use this query SELECT * FROM `sales_order` WHERE date(created_at) >= '2020-12-02' AND (date( created_at) <= '2020-12-...
Friska Sianturi's user avatar
0 votes
1 answer
135 views

How to add media query for div alignment [closed]

My design, I need mobile view like, first block second block third block fourth block How to include media query? Script : <div class="container"> <div class="...
zus's user avatar
  • 155
1 vote
2 answers
1k views

Retrieve product url with category in the graphQL

I've enabled at backoffice the usage of the category inside the product url by setting this option: When I access the magento frontend, I can now access the product with the url <category>/<...
Pasquale's user avatar
  • 218
0 votes
1 answer
72 views

Change stock availability of products based on qty

I'm looking for a query to get all my products that have "qty > 2 and 'stock availability = 0'" and change the stock availability to 1. A crash on my inventory update routine did a mess ...
Ralf O's user avatar
  • 57
0 votes
2 answers
195 views

how do I change this sql query to magento get data method?

I have below sql query, how do I turn this to Magento get data method to retrieve data? Please help SELECT sales_order.increment_id, sales_order_payment.additional_information FROM sales_order LEFT ...
Paul Fan's user avatar
  • 614
0 votes
1 answer
1k views

How to change product status from sql using SKU

I need to disable and enable a huge quantity of products filtering by sku and the easiest solution seem to be through Sql query but i have some issues to find the right code For example i need to ...
Gianluca Giogli's user avatar
0 votes
1 answer
2k views

Using GraphQL query and filtering products by category_id, I get empty items array

I try to make a simple request using graphql and to get a response from my magento. I have a parent category named Products(id:"3"). In this one, there are 3 subcategories A(id:"5")...
Kostas Katsinaris's user avatar
0 votes
1 answer
326 views

How to get SQL query for product insert in Magento 2?

How to get SQL query for product insert in Magento 2 ? I have multiple products around 10 Lakhs so i want to insert it using SQL query. But how will i get the insert query of the product ? Any Help is ...
Prits's user avatar
  • 626
0 votes
0 answers
663 views

magento 2 change store id

I have a multi store Magento 2 site and I need to change the ID of one of the stores. Is there any easy way to do this? I tried to run an update query on the store table but I get and error because ...
Trevor Orr's user avatar

1
2 3 4 5
7