1. Goto: http://_JBOSS SERVER IP_:_JBOSS SERVER PORT_/admin-console
2. Login In.
3. Click on JBossAS Servers -> JBoss AS X (XXX) link.
and this will give you the version.
Wednesday, 23 March 2011
Friday, 18 March 2011
ROLLUP IN ORACLE.
DROP TABLE EMPLOYEE;
CREATE TABLE EMPLOYEE(
COMPANY_ID NUMBER,
DEP_DESIG VARCHAR(20),
SALARY NUMBER
);
INSERT INTO EMPLOYEE VALUES(10,'Developer',80);
INSERT INTO EMPLOYEE VALUES(10,'Manager',100);
INSERT INTO EMPLOYEE VALUES(10,'CEO',150);
INSERT INTO EMPLOYEE VALUES(20,'Developer',100);
INSERT INTO EMPLOYEE VALUES(20,'Manager',500);
INSERT INTO EMPLOYEE VALUES(20,'CEO',600);
SELECT COMPANY_ID, DEP_DESIG, COUNT(*), SUM(SALARY)
FROM EMPLOYEE
GROUP BY rollup(COMPANY_ID,DEP_DESIG) ORDER BY COMPANY_ID;
CREATE TABLE EMPLOYEE(
COMPANY_ID NUMBER,
DEP_DESIG VARCHAR(20),
SALARY NUMBER
);
INSERT INTO EMPLOYEE VALUES(10,'Developer',80);
INSERT INTO EMPLOYEE VALUES(10,'Manager',100);
INSERT INTO EMPLOYEE VALUES(10,'CEO',150);
INSERT INTO EMPLOYEE VALUES(20,'Developer',100);
INSERT INTO EMPLOYEE VALUES(20,'Manager',500);
INSERT INTO EMPLOYEE VALUES(20,'CEO',600);
SELECT COMPANY_ID, DEP_DESIG, COUNT(*), SUM(SALARY)
FROM EMPLOYEE
GROUP BY rollup(COMPANY_ID,DEP_DESIG) ORDER BY COMPANY_ID;
CUBE IN ORACLE.
DROP TABLE EMPLOYEE;
CREATE TABLE EMPLOYEE(
COMPANY_ID NUMBER,
DEP_DESIG VARCHAR(20),
SALARY NUMBER
);
INSERT INTO EMPLOYEE VALUES(10,'Developer',80);
INSERT INTO EMPLOYEE VALUES(10,'Manager',100);
INSERT INTO EMPLOYEE VALUES(10,'CEO',150);
INSERT INTO EMPLOYEE VALUES(20,'Developer',100);
INSERT INTO EMPLOYEE VALUES(20,'Manager',500);
INSERT INTO EMPLOYEE VALUES(20,'CEO',600);
SELECT COMPANY_ID, DEP_DESIG, COUNT(*), SUM(SALARY)
FROM EMPLOYEE
GROUP BY CUBE(COMPANY_ID,DEP_DESIG) ORDER BY COMPANY_ID;
OUTPUT:
-------
COMPANY_ID DEP_DESIG COUNT(*) SUM(SALARY)
---------------------- -------------------- ---------------------- ----------------------
10 CEO 1 150
10 Developer 1 80
10 Manager 1 100
10 3 330
20 CEO 1 600
20 Developer 1 100
20 Manager 1 500
20 3 1200
CEO 2 750
Developer 2 180
Manager 2 600
6 1530
12 rows selected
CREATE TABLE EMPLOYEE(
COMPANY_ID NUMBER,
DEP_DESIG VARCHAR(20),
SALARY NUMBER
);
INSERT INTO EMPLOYEE VALUES(10,'Developer',80);
INSERT INTO EMPLOYEE VALUES(10,'Manager',100);
INSERT INTO EMPLOYEE VALUES(10,'CEO',150);
INSERT INTO EMPLOYEE VALUES(20,'Developer',100);
INSERT INTO EMPLOYEE VALUES(20,'Manager',500);
INSERT INTO EMPLOYEE VALUES(20,'CEO',600);
SELECT COMPANY_ID, DEP_DESIG, COUNT(*), SUM(SALARY)
FROM EMPLOYEE
GROUP BY CUBE(COMPANY_ID,DEP_DESIG) ORDER BY COMPANY_ID;
OUTPUT:
-------
COMPANY_ID DEP_DESIG COUNT(*) SUM(SALARY)
---------------------- -------------------- ---------------------- ----------------------
10 CEO 1 150
10 Developer 1 80
10 Manager 1 100
10 3 330
20 CEO 1 600
20 Developer 1 100
20 Manager 1 500
20 3 1200
CEO 2 750
Developer 2 180
Manager 2 600
6 1530
12 rows selected
MINUS IN ORACLE AND OUTER JOINS IN ORACLE
To see the different try the following:
DROP TABLE FOO;
DROP TABLE BAR;
CREATE TABLE FOO(
FOO_ID NUMBER,
FOO_NAME VARCHAR(20)
);
CREATE TABLE BAR(
BAR_ID NUMBER,
BAR_NAME VARCHAR(20)
);
INSERT INTO FOO VALUES(1,'Fawad');
INSERT INTO FOO VALUES(2,'Nazir');
INSERT INTO BAR VALUES(1,'Fawad');
INSERT INTO BAR VALUES(2,'Nazir');
INSERT INTO BAR VALUES(3,'Hello');
INSERT INTO BAR VALUES(4,'World');
-- Minus
SELECT BAR_ID FROM BAR
MINUS
SELECT FOO_ID FROM FOO
-- Right outer join
SELECT BAR_ID FROM FOO F RIGHT JOIN BAR B ON F.FOO_ID = B.BAR_ID WHERE FOO_ID IS NULL AND FOO_NAME IS NULL
In this case Both of the above queries give same results.
DROP TABLE FOO;
DROP TABLE BAR;
CREATE TABLE FOO(
FOO_ID NUMBER,
FOO_NAME VARCHAR(20)
);
CREATE TABLE BAR(
BAR_ID NUMBER,
BAR_NAME VARCHAR(20)
);
INSERT INTO FOO VALUES(1,'Fawad');
INSERT INTO FOO VALUES(2,'Nazir');
INSERT INTO BAR VALUES(1,'Fawad');
INSERT INTO BAR VALUES(2,'Nazir');
INSERT INTO BAR VALUES(3,'Hello');
INSERT INTO BAR VALUES(4,'World');
-- Minus
SELECT BAR_ID FROM BAR
MINUS
SELECT FOO_ID FROM FOO
-- Right outer join
SELECT BAR_ID FROM FOO F RIGHT JOIN BAR B ON F.FOO_ID = B.BAR_ID WHERE FOO_ID IS NULL AND FOO_NAME IS NULL
In this case Both of the above queries give same results.
Tuesday, 1 March 2011
Day of the week, Day of the week for previous day in Oracle
select to_char(to_date('15-09-2010','dd-MM-yyyy'),'D') from dual; -- day of week for a date
select to_char(to_date('15-09-2010','dd-MM-yyyy')-1,'D') from dual; -- day of week for a date before
select to_char(to_date('15-09-2010','dd-MM-yyyy')-1,'D') from dual; -- day of week for a date before
Subscribe to:
Posts (Atom)
Azure OpenAI Architecture Patterns & Deployment Patterns
Sharing some useful links that will help customers architect Azure OpenAI solution using the best practices: (1) Azure OpenAI Landing Zone r...
-
Setting up a MPI cluster on Ubuntu involves the following steps: 1. Install OpenMPI on all machines. $sudo apt-get install libopenmpi-de...
-
Very Useful Link: http://people.cc.ku.edu/~grobe/intro-to-LSL/index.html#particle Using the Linden Script Language This page is a short...
-
float p_size = 0.1; default { state_entry() { llSay(0, "Hello, Avatar!"); llSetPrimitiveParams( [ PRIM_...