Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 46880

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

0 votes
2 answers
1k views

Getting all customer addresses which have empty required fields

I'm fairly new to Magento, but I know there is a way you can do this in code and call the ->getSelect() to ouput a query which I can use to output the data to csv and to later remove all those addresses … I have little experience with Magento's query language, but this seems challenging even to more experienced Magento developers, so if you can get me on my way with this, I would be extremely grateful. …
Nico V's user avatar
  • 87
0 votes

Getting all customer addresses which have empty required fields

After some more searching and trial and error, I've found following query to give me the results that I wanted: SELECT caev.value FirstName, caev2.value LastName, caet.value Address, caev3.value City, … ),25 (street),26 (city),27 (country_id),28 (region),30 (postcode),31 (telephone) Query 2 to get a list of all addresses which have empty required (just to get a visual representatation of all incomplete …
Nico V's user avatar
  • 87
0 votes
1 answer
703 views

SQL: Calculate the sum of a column based on 2 other columns in where clause (Magento 1.9.3.6)

I've got a bit of an interesting problem: I have a database where questions and answers are saved, each question/answer combo is saved as a separate row, sharing a participation id between each entry. …
Nico V's user avatar
  • 87
0 votes

SQL: Calculate the sum of a column based on 2 other columns in where clause (Magento 1.9.3.6)

Okay, so I didn't get it to work with Magento's built-in query builder, but I did find a solution: just use direct sql and always get all the totals as array and based on an optional parameter return the …
Nico V's user avatar
  • 87
0 votes
1 answer
584 views

Get stock items based on simple product id

I'm fairly new to Magento and came across a situation where I need to get data (specifically available quantity) of all simple products connected to its configurable product. I've managed to get the …
Nico V's user avatar
  • 87
0 votes

Get stock items based on simple product id

Okay, after some more digging and fiddling, I've found a solution. Maybe not the best, but this works for me: $simpleProductIds = Mage::getModel('catalog/product_type_configurable')->getUsedProductId …
Nico V's user avatar
  • 87