
Search In
For combine the result of two or more select query we use union in sql query.If you want to use union in yii query you can use the below code
$queryFirst = (new \yii\db\Query())
->select("id, name")
->from('tableA')
->limit(10);
Let's create a table with duplicate rows in SQL.
create table CustomerDuplicate(customer_id int,customer_name varchar(20))
insert into CustomerDuplicate values(1,'Adam')
insert into CustomerDuplicate values (1,'Adam')
insert into CustomerDuplicate
Many times we come across a requirement of finding names of all tables which contain specific columns. We can get the answer by using the below query:
SELECT COL.name AS ColumnName, TAB.name AS TableName
FROM sys.columns COL
JOIN sys.tables TAB
To get small image in product module first inherit the product.product object in product module and add one fields like image_small and write the fucntion _get_image in your own module in openerp.
for example you can use the below fucntion in .py fil
Whenever we create a form, we always have a requirement to put validation for empty fields on some input fields on form submit. For this we use onSubmit attribute of the form, inside which we can define a function that will have validations.
Example
In openerp you make a request to read the assets while the transaction creating is not done and As the assets are generated during the same transaction and the rendering of the templates will call them. There is a scenario where the assets are unreac
Triggers in SQL of a table can be find by writing a SQL query and passing table name as its parameter for the query
We will just pass the table name for that and it will provide all the triggers made for that table.
Ex: select so.name, text
fro
This post will help you to attach the page information to URLs, lets assume that If you want to store a small fragment of information to the URLs in such a way that the information should be available to anyone who is accessing the page.
The informa
Identity field is usually used as a primary key. When you insert a new record into your table, this field automatically assign an incremented value from the previous entry.
Ex:
CREATE TABLE Customer
(
ID int IDENTITY,
Updating a column value using Update Statement:
UPDATE statement is used to change the value for a column or to change multiple records using a condition. It is a data manipulation language command which are used for managing data.
Syntax:
UPDATE
