Customers
Customers is an auto generated table
Select
The Customers table supports server-side processing for all columns in the WHERE clause. Most of these columns support server-side processing for the >, >=, <, <=, =, IN, NOT IN and LIKE operators.
The following examples show the types of queries processed server side.
- Retrieve all customers from your Magento server.
SELECT * FROM Customers
- Retrieve a single customer:
SELECT * FROM Customers WHERE Id = '1'
- Filter by status:
SELECT * FROM Customers WHERE GroupId = 1
- Filter by created date:
SELECT * FROM Customers WHERE CreatedAt > '2017-08-01'
- Example query with multiple filters:
SELECT * FROM Customers WHERE DefaultBilling IN (1,2) AND Firstname LIKE '%i%' AND WebsiteId=1 LIMIT 50
Insert
To add a Customer, the FirstName, LastName, and Email fields are required.
INSERT INTO Customers(FirstName,LastName,Email,WebsiteId,GroupId) VALUES ('John','Doe','[email protected]',1,1)
Update
Magento allows updates for the FirstName, LastName, MiddleName, Suffix, Email, GroupId, Prefix, DisableAutoGroupChange, and Taxvat columns. WebsiteId is a required value.
UPDATE Customers SET FirstName='Jane', Email='[email protected]', GroupId=2, DisableAutoGroupChange='0', Prefix='x', Middlename='J', LastName='Doe', Suffix='y',Taxvat=1, WebsiteId=1 WHERE Id = 4
Delete
Customers can be deleted by providing the Id of the Customer and issuing a DELETE statement.
DELETE FROM Customers WHERE Id = 4
Columns
Name | Type | ReadOnly | Description |
Id [KEY] | Int | False |
Customer id |
Addresses | String | False |
Customer addresses. |
Confirmation | String | False |
Confirmation |
CreatedAt | Datetime | False |
Created at time |
CreatedIn | String | False |
Created in area |
DefaultBilling | String | False |
Default billing address id |
DefaultShipping | String | False |
Default shipping address id |
DisableAutoGroupChange | Int | False |
Disable auto group change flag. |
Dob | String | False |
Date of birth |
String | False |
Email address | |
ExtensionAttributes | String | False |
This is an auto-generated column |
Firstname | String | False |
First name |
Gender | Int | False |
Gender |
GroupId | Int | False |
Group id |
Lastname | String | False |
Last name |
Middlename | String | False |
Middle name |
Prefix | String | False |
Prefix |
StoreId | Int | False |
Store id |
Suffix | String | False |
Suffix |
Taxvat | String | False |
Tax Vat |
UpdatedAt | Datetime | False |
Updated at time |
WebsiteId | Int | False |
Website id |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.
Name | Type | Description |
Id_p | String |
This is an auto-generated column |