Within Oracle BI Answers (and only within BI Answers and not within the Metadata model), the BY clause can be used in conjunction with a… 159 more words
It’s not entirely uncommon to want to group by a computed expression in an aggregation query. The trouble is, whenever you group by a computed expression, SQL Server considers the ordering of the data to be lost, and this will turn your buttery-smooth Stream Aggregate operation into a Hash Match (aggregate) or create a corrective Sort operation, both of which are… 1,206 more words
Simple Query to find the Specific character from a string.
Let us consider, a String ‘thisisagoodplace’ and want to find the count of ‘a’ in the string this below query will work. 30 more words
- The following two tables are used to store Employee and their salary records.
CREATE TABLE EMPLOYEE (EMP_ID NUMBER GENERATED ALWAYS AS IDENTITY, NAME VARCHAR2(50) NOT NULL, DATE_OF_BIRTH DATE NOT NULL, DESIGNATION VARCHAR2(50) NOT NULL, DATE_OF_JOINING DATE, DATE_OF_RESIGNATION DATE, LAST_WORKING_DAY DATE, CONSTRAINT EMPLOYEE_PK PRIMARY KEY(EMP_ID)); CREATE TABLE EMPLOYEE_SALARY(EMP_ID NUMBER NOT NULL, MONTH NUMBER(2) NOT NULL, YEAR NUMBER(4) NOT NULL, GROSS_EARNINGS NUMBER(10,2) NOT NULL, DEDUCTIONS NUMBER(10,2) DEFAULT 0 ON NULL, NET_SALARY AS (TOTAL_EARNINGS - TOTAL_DEDUCTIONS), CONSTRAINT EMPLOYEE_SALARY_PK PRIMARY KEY (EMP_ID), CONSTRAINT EMPLOYEE_SALARY_FK1 FOREIGN KEY (EMP_ID) REFERENCES EMPLOYEE(EMP_ID)); 610 more words