SELECT itemid, Qty, actualPrice, subtotal FROM SalesOrderDetail s WHERE actualPrice< 1000 COMPUTE SUM(Qty), SUM(subtotal)
Labels
- AVG() Function (1)
- Aggregate Functions (1)
- Candidate Key (1)
- Composite and Compound Keys (1)
- EXISTS (1)
- FIRST() Function (1)
- Group By Statement (1)
- Having Clause (1)
- INSERT (1)
- LIKE (1)
- SELECT AS CLAUSE (1)
- SQL Distinct Unique Records (1)
- SQL IN (1)
- SQL Joins (1)
- SQL Last() Function (1)
- SQL NULL Conditional (1)
- SQL Not Exists (1)
- SQLComparison Operators (1)
- Sql Max() Function (1)
- Sql Min() Function (1)
- Sql SUM() Function (1)
- WHERE (1)
Wednesday, July 21, 2010
Calculate Grand Total in SQL Query
Wednesday, June 23, 2010
Date wise SQL Query
Select employee_id, employee_name (Select count(*) from employee_leave el where e.employee_id=el.employee_id and el.leave_date between e.hire_Date and '2010-06-20 23:59:59') from tbl_employee e where e.hire_date between '2010-06-01 00:00:00' and '2010-06-01 23:59:59'here in the above query for extracting the total leaves the final date has been set from the employee hire date.
Tuesday, May 25, 2010
Generate Mapping against target Step
Pentaho Spoon Installation
chmod +x *.sh
Spoon.bat: launch Spoon on the Windows platform.
sh spoon.sh: launch Spoon on a Unixlike
platform: Linux, Apple OSX, Solaris, ...
If you want to make a shortcut under the Windows platform an icon is provided: “spoon.ico” to set the correct icon. Simply point the shortcut to the Spoon.bat file.
Supported platforms
- The Spoon GUI is supported on the following platforms:
- Microsoft Windows: all platforms since Windows 95, including Vista
- Linux GTK: on i386 and x86_64 processors
- Apple's OSX: works both on PowerPC and Intel machines
- Solaris: using a Motif interface (GTK optional)
- AIX: using a Motif interface
- HPUX:
Friday, May 21, 2010
Group by SQL Query
Select c.country_name, count(s.id) from tbl_sales s inner join tbl_country c on s.country_id=c.country_id where s.saels_date between '2010-05-01 00:00:00' and '2010-05-31 23:59:59' group by c.coutnry_name
Sunday, May 16, 2010
How to Insert Extracted Values in Pentaho Spoon
To insert the extracted records from the transactional source database into the destination or data warehouse following is simple way to do it.
Open the Pentaho Spoon go to file menu and open new Transformation.
in the design mode drill down the Input Folder and drag & drop the Table Input Step, double click the Table Input and set the source database (How to Set Connection Parameters in Pentaho Spoon)connection parameters this will extract all required fields
Again go to the design mode and this time drag & drop the INERT / UPDATE Step lying under the OUT PUT Folder now hold the Shift key and place your mouse icon over the TABLE INPUT and drag upto the INERT / UPDATE Step this will generate a Green color Arrow called a hope with its tail at the TABLE INPUT and head towards INERT / UPDATE Step.
You can enable, disable or even delete the hope by placing your mouse over it and with right click. now double click the INERT / UPDATE Step
and set target Database Connection by clicking the New Button for the connection and Edit if you have it already.
For the first grid Click the Get Fields Button this will fill grid with all values you have queried in the previous Table Input Step here in this grid keep only those fields on the basis of which you will insert record.
Loading XML Data Using Pentaho ETL Tool
Go to the design mode, drill down the input folder and drag & drop the XML Input Step.
Below this Grid there is a Show File(s) options that allow you to view your complete files addresses.
Nnow go to the next tab of Fields followed by Content tab.
To view all these contents of your XML file you can use the XML OUTPUT Step available under the Out put folder.
SQL Query For Monthly Calculation
Saturday, May 15, 2010
Concatenation in Pentaho Kettle
How to Split a String in pentaho Kettle
var ID = employee [0];
var Name= employee [1];
var Address = employee [2];