Wednesday, July 29, 2009

Linux Tips using tar

TIPS:
tar is an archiving utility.it can also be used to create pr decompress gzip or bzip2 files.

1.(Using the tar command to create a ".tar.gz" file or folder/stuff)
$ tar -czvf stuff.tar.gz stuff

2.(Using the tar command to create a ".tar.bz2" file or folder/stuff)
$ tar -cjvf stuff.tar.bz2 stuff

3.(list the files in the archive of gzip)
$ tar -tzvf stuff.tar.gz

4.(list the files in the archive of bzip2)
$ tar -tjvf stuff.tar.bz2

5.To extract only one file from archive
$ tar -xvf stuff.tar Example.txt
the above command will only get the Example file from the archive

6.To extract a '.tar.gz' file
$ tar -zxvf stuff.tar.gz

7.To extract a '.tar.bz2' file
$ tar -jxvf stuff.tar.bz2


JSON with example

GO THRO' IT:

JSON (JavaScript Object Notation):
- A lightweight data-interchange format.

- Easy for humans to read and write.

- Easy for machines to parse and generate

JSON is built on two data structures:
- A collection of name/value pairs (unordered structure).

- An ordered list of values.
JSON's basic types:
  • Number (integer, real, or floating point)
  • String (double-quoted Unicode with backslash escaping)
  • Boolean (true and false)
  • Array (an ordered sequence of values, comma-separated and enclosed in square brackets)
  • Hashtable or Map (collection of key: value pairs, comma-separated and enclosed in curly braces)
  • null
Sample JSON Format:

{

“firstname”:”John”,
“lastname”:”Smith”,
“address”:{

“streetaddress”:”21,2nd Street”,
“city”:”Chennai”,
“state”:”TN”,
“postalcode”:”600090”
},
“phonenumbers”:[

“044-22772299”,
“044-28888888”]

}

>>The above example explain the JSON representation of an object that describes a person. The object has string fields for first name and last name, contains an object representing the person's address, and contains a list of phone numbers (an array).
>>It is based on a subset of the JavaScript Programming Language,ECMA-262 3rd Edition - December 1999.

Thanks
A.T.J

Friday, July 24, 2009

JDK and JRE File Structure

Development Files and Directories:
>>This tip provides an introductory overview of the JDK directories and the files they contain. Note that the file structure of the JRE is identical to that of the JDK's jre directory.
>>This section describes the most important files and directories required to develop
         jdk1.6.0
___________|_________________
| | |
bin lib jre
| | ________|__________
java* tools.jar | |
javac* dt.jar bin lib

javap* | ________ ___|___ _________ ________ _______
javah* java* | | | | | |
javadoc* rt.jar ext security sparc applet fonts
charsets.jar | / \
localedata.jar server client




Assuming the JDK software is installed at /jdk1.6.0, here are some of the most important directories:
/jdk1.6.0
Root directory of the JDK software installation. Contains copyright, license, and README files. Also contains src.zip, the archive of source code for the Java platform.
/jdk1.6.0/bin
Executables for all the development tools contained in the JDK. The PATH environment variable should contain an entry for this directory. For more information on the tools, see JDK Tools.
/jdk1.6.0/lib
Files used by the development tools. Includes tools.jar, which contains non-core classes for support of the tools and utilities in the JDK. Also includes dt.jar, the DesignTime archive of BeanInfo files that tell interactive development environments (IDE's) how to display the Java components and how to let the developer customize them for an application.
/jdk1.6.0/jre
Root directory of the Java runtime environment used by the JDK development tools. The runtime environment is an implementation of the Java platform. This is the directory referred to by the java.home system property.
/jdk1.6.0/jre/bin
Executable files for tools and libraries used by the Java platform. The executable files are identical to files in /jdk1.6.0/bin. The java launcher tool serves as an application launcher (and replaced the old jre tool that shipped with 1.1 versions of the JDK). This directory does not need to be in the PATH environment variable.
/jdk1.6.0/jre/lib
Code libraries, property settings, and resource files used by the Java runtime environment. For example:
>>rt.jar -- the bootstrap classes (the RunTime classes that comprise the Java platform's core API).
>>charsets.jar -- character-conversion classes.
Aside from the ext subdirectory (described below) there are several additional resource subdirectories not described here.
/jdk1.6.0/jre/lib/ext
Default installation directory for Extensions to the Java platform. This is where the JavaHelp jar file goes when it is installed, for example.

>>localedata.jar -- locale data for java.text and java.util.
/jdk1.6.0/jre/lib/security
Contains files used for security management. These include the security policy (java.policy) and security properties (java.security) files.
/jdk1.6.0/jre/lib/sparc
Contains the .so (shared object) files used by the Solaris version of the Java platform.
/jdk1.6.0/jre/lib/sparc/client
Contains the .so file used by the Java HotSpotTM Client Virtual Machine, which is implemented with Java HotSpotTM technology. This is the default VM.
/jdk1.6.0/jre/lib/sparc/server
Contains the .so file used by the Java HotSpotTM Server Virtual Machine.
/jdk1.6.0/jre/lib/applet
Jar files containing support classes for applets can be placed in the lib/applet/ directory. This reduces startup time for large applets by allowing applet classes to be pre-loaded from the local file system by the applet class loader, providing the same protections as if they had been downloaded over the net.
/jdk1.6.0/jre/lib/fonts
Font files for use by platform.
These things i got from sun.com..........its really very help full for u to understand the file structures in java.
Thanks
A.T.J

Thursday, July 23, 2009

vi Editor Tips

TIPS:
vi - is a programmers text editor.

The editor can be used to create scripts or any type of file in Linux.

To try the below options, open a sample file.

$ vi samplefile.txt

Following are the short cuts used in vi editor:


Command :Result
Yy:to copy the current line
y3 and down arrow:to copy 3 lines below the current line
Dd:to cut/delete the current line
d3 and down arrow:to delete 3 lines below the current line
P:to paste the copied line
U:Undo last change
R:Redo last change
X:Delete character
Dw:Delete word
Q!:Quit without saving file
Ctrl f:Move forward one page
Ctrl b:Move backward one page

Thanks
A.T.J

100 Shortcuts using keyboard

CHECKOUT THIS:
CTRL+C ::::::(Copy)
CTRL+X ::::::(Cut)
CTRL+V ::::::(Paste)
CTRL+Z ::::::(Undo)
DELETE ::::::(Delete)
SHIFT+DELETE::: :::(Delete the selected item permanently without placing the item inthe Recycle Bin)
CTRL while dragging an item :::(Copy the selected item)
CTRL+SHIFT while dragging an item :::(Create a shortcut to the selected item)
F2 key ::::::(Rename the selected item)
CTRL+RIGHT ARROW ::::::(Move the insertion point to the beginning of the nextword)CTRL+LEFT ARROW ::::::(Move the insertion point to the beginning of the previousword)CTRL+DOWN ARROW::: :::(Move the insertion point to the beginning of the nextparagraph)CTRL+UP ARROW ::::::(Move the insertion point to the beginning of the previousparagraph)CTRL+SHIFT with any of the arrow keys :::(Highlight a block of text)
SHIFT with any of the arrow keys :::(Select more than one item in a window or on thedesktop, or select text in a document)
CTRL+A ::::::(Select all)
F3 key ::::::(Search for a file or a folder)
ALT+ENTER::: :::(View the properties for the selected item)
ALT+F4 ::::::(Close the active item, or quit the active program)
ALT+ENTER::: :::(Display the properties of the selected object)
ALT+SPACEBAR::: :::(Open the shortcut menu for the active window)
CTRL+F4 ::::::(Close the active document in programs that enable you to have multipledocuments open simultaneously)
ALT+TAB :::(Switch between the open items)
ALT+ESC :::(Cycle through items in the order that they had been opened)
F6 key :::(Cycle through the screen elements in a window or on the desktop)
F4 key :::(Display the Address bar list in My Computer or Windows Explorer)
SHIFT+F10 :::(Display the shortcut menu for the selected item)
ALT+SPACEBAR :::(Display the System menu for the active window)
CTRL+ESC :::(Display the Start menu)
ALT+Underlined letter in a menu name :::(Display the corresponding menu)
Underlined letter in a command name on an open menu :::(Perform the correspondingcommand)F10 key :::(Activate the menu bar in the active program)
RIGHT ARROW :::(Open the next menu to the right, or open a submenu)
LEFT ARROW :::(Open the next menu to the left, or close a submenu)
F5 key :::(Update the active window)
BACKSPACE :::(View the folder one level up in My Computer or Windows Explorer)
ESC :::(Cancel the current task)
SHIFT when you insert a CD-ROM into the CD-ROM drive :::(Prevent the CD-ROMfrom automatically playing)
Dialog Box Keyboard ShortcutsCTRL+TAB :::(Move forward through the tabs)CTRL+SHIFT+TAB :::(Move backward through the tabs)
TAB :::(Move forward through the options)
SHIFT+TAB :::(Move backward through the options)
ALT+Underlined letter :::(Perform the corresponding command or select thecorresponding option)
ENTER :::(Perform the command for the active option or button)
SPACEBAR :::(Select or clear the check box if the active option is a check box)
Arrow keys :::(Select a button if the active option is a group of option buttons)
F1 key :::(Display Help)
F4 key :::(Display the items in the active list)
BACKSPACE :::(Open a folder one level up if a folder is selected in the Save As orOpen dialog box)
m*cro$oft Natural Keyboard ShortcutsWindows Logo :::(Display or hide the Start menu)Windows Logo+BREAK :::(Display the System Properties dialog box)
Windows Logo+D :::(Display the desktop)
Windows Logo+M :::(Minimize all of the windows)
Windows Logo+SHIFT+M :::(Restore the minimized windows)
Windows Logo+E :::(Open My Computer)
Windows Logo+F :::(Search for a file or a folder)
CTRL+Windows Logo+F :::(Search for computers)
Windows Logo+F1 :::(Display Windows Help)
Windows Logo+ L :::(Lock the keyboard)
Windows Logo+R :::(Open the Run dialog box)
Windows Logo+U :::(Open Utility Manager)
Accessibility Keyboard ShortcutsRight SHIFT for eight seconds :::(Switch FilterKeys either on or off)
Left ALT+left SHIFT+PRINT SCREEN :::(Switch High Contrast either on or off)
Left ALT+left SHIFT+NUM LOCK :::(Switch the MouseKeys either on or off)
SHIFT five times :::(Switch the StickyKeys either on or off)
NUM LOCK for five seconds :::(Switch the ToggleKeys either on or off)
Windows Logo +U :::(Open Utility Manager)
Windows Explorer Keyboard ShortcutsEND :::(Display the bottom of the active window)HOME :::(Display the top of the active window)
NUM LOCK+Asterisk sign :::(*) :::(Display all of the subfolders that are under theselected folder)
NUM LOCK+Plus sign :::(+) :::(Display the contents of the selected folder)
NUM LOCK+Minus sign :::(-) :::(Collapse the selected folder)
LEFT ARROW :::(Collapse the current selection if it is expanded, or select the parentfolder)RIGHT ARROW :::(Display the current selection if it is collapsed, or select the firstsubfolder)Shortcut Keys for Character MapAfter you double-click a character on the grid of characters, you can move through thegrid by using the keyboard shortcuts:
RIGHT ARROW :::(Move to the right or to the beginning of the next line)
LEFT ARROW :::(Move to the left or to the end of the previous line)
UP ARROW :::(Move up one row)
DOWN ARROW :::(Move down one row)
PAGE UP :::(Move up one screen at a time)
PAGE DOWN :::(Move down one screen at a time)
HOME :::(Move to the beginning of the line)
END :::(Move to the end of the line)
CTRL+HOME :::(Move to the first character)
CTRL+END :::(Move to the last character)
SPACEBAR :::(Switch between Enlarged and Normal mode when a character isselected)m*cro$oft Management Console :::(MMC)
Main Window Keyboard ShortcutsCTRL+O :::(Open a saved console)
CTRL+N :::(Open a new console)
CTRL+S :::(Save the open console)
CTRL+M :::(Add or remove a console item)
CTRL+W :::(Open a new window)
F5 key :::(Update the content of all console windows)
ALT+SPACEBAR :::(Display the MMC window menu)
ALT+F4 :::(Close the console)
ALT+A :::(Display the Action menu)
ALT+V :::(Display the View menu)
ALT+F :::(Display the File menu)
ALT+O :::(Display the Favorites menu)
MMC Console Window Keyboard ShortcutsCTRL+P :::(Print the current page or active pane)ALT+Minus sign :::(-) :::(Display the window menu for the active console window)SHIFT+F10 :::(Display the Action shortcut menu for the selected item)
F1 key :::(Open the Help topic, if any, for the selected item)
F5 key :::(Update the content of all console windows)
CTRL+F10 :::(Maximize the active console window)
CTRL+F5 :::(Restore the active console window)
ALT+ENTER :::(Display the Properties dialog box, if any, for the selected item)
F2 key :::(Rename the selected item)
CTRL+F4 :::(Close the active console window. When a console has only one consolewindow, this shortcut closes the console)
Remote Desktop Connection NavigationCTRL+ALT+END :::(Open the m*cro$oft Windows NT Security dialog box)
ALT+PAGE UP :::(Switch between programs from left to right)
ALT+PAGE DOWN :::(Switch between programs from right to left)
ALT+INSERT :::(Cycle through the programs in most recently used order)
ALT+HOME :::(Display the Start menu)
CTRL+ALT+BREAK :::(Switch the client computer between a window and a fullscreen)ALT+DELETE :::(Display the Windows menu)
CTRL+ALT+Minus sign :::(-) :::(Place a snapshot of the active window in the client onthe Terminal server clipboard and provide the same functionality as pressing PRINTSCREEN on a local computer.)
CTRL+ALT+Plus sign :::(+) :::(Place a snapshot of the entire client window area on theTerminal server clipboard and provide the same functionality as pressing ALT+PRINTSCREEN on a local computer.)
m*cro$oft Internet Explorer NavigationCTRL+B :::(Open the Organize Favorites dialog box)CTRL+E :::(Open the Search bar)
CTRL+F :::(Start the Find utility)
CTRL+H :::(Open the History bar)
CTRL+I :::(Open the Favorites bar)
CTRL+L :::(Open the Open dialog box)
CTRL+N :::(Start another instance of the browser with the same Web address)
CTRL+O :::(Open the Open dialog box, the same as CTRL+L)
CTRL+P :::(Open the Print dialog box)
CTRL+R :::(Update the current Web page)
CTRL+W :::(Close the current window)
Thanks
A.T.J

Wednesday, July 22, 2009

JavaScript Code for filtering Non Numeric Value

CODE:


function filterNonNumeric(field) {
var result = new String();
var numbers = "0123456789";
var chars = field.value.split(""); // create array
for (i = 0; i < value =" result;">

......The above code filter the non numeric value .........i.e, when ever user enter the value other than numeric it wont allow you to enter it accepts only the numeric value
.....the input for the above java script function is property/ name from the Textbox in Jsp

for ex..from jsp (please ignore the starting symbol(--) in tag


<--input type=text name="units">

the above name units is given to that function.
having doubt on this .......leave .....a..comment
Thanks
A.T.J


Saturday, July 18, 2009

Solution for-ORA-00034:cannot string in current PL/SQL session

REASON:

In a session if you disabled the COMMIT/ROLLBACK. In this scenario if you try to issue a COMMIT/ROLLBACK through any of the PL/SQL objects like(procedure, function, package).

SOLUTION:
If you enable the commit in current session it will get rectified
else
don issue the COMMIT/ROLLBACK in the current session.

Solution for-ORA-00054:resource busy and acquire with NOWAIT specified

REASON:

When ever you are trying to access the table for DML oprartion in the database.you will get this error.


SOLUTION:

better execute the COMMIT statement for this and try it

Ex:

Sql>COMMIT;

Thanks
A.T.J

Solution for-ORA-00904:string: invalid identifier

REASON:

if you entered a invalid column name in SELECT,UPDATE queries you will get this error
So you have to check the below conditions.

SOLUTION :
1.please enter the valid column name from the table.
2.Column name criterias:
a.Column name should not be reserved words.
b.Column name must begin with a letter.
c.Column name should be <=30 Characters and consist of alpha numeric char.. and Special char.. like #,_ and $. Thanks
A.T.J

Solution for-ORA-12154:TNS:could not resolve the connect identifier specified

SOLUTION:

The reason for this error is connection identifier is not specified in the connection descriptor list so the connect identifier could not be resolved For Ex.if i use the type of connection identifier service name is BUSINESS if this name is not specified/configured in the namings list you will get this error.

Basically naming configured in three ways :
1.Directory naming.
2.Local naming(TNSNAMES.ORA file).
3. Easy connect naming.

SOLUTION IF YOU ARE USING Directory Naming:

>Check whether "LDAP" is listed as one of the values of the NAMES.DIRETORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).
>Check whether the BUSINESS service name or database name used as the connect identifier is configured in the directory.
>Check whether the LDAP directory server is up and that it is accessible.
>Check whether the default context being used is correct by specifying a fully qualified BUSINESS service name or a full LDAP DN as the connect identifier.

SOLUTION IF YOU ARE USING Local naming(TNSNAMES.ORA file):
>First thing you have to confirm whether the TNSNAMES.ORA file exists and is in the proper directory and is accessible.
>Check that the BUSINESS service name used as the connect identifier exists in the TNSNAMES.ORA file.
>Basically the TNSNAMES.ORA is in the ADMIN folder under the ORACLE folder if if the ADMIN folder is not created while installing the oracle please create the ADMIN folder and paste the TNSNAMES.ORA file(refer the first point).
>Make sure that "TNSNAMES" is listed as one of the values of the NAMES.DIRECTORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).
>check whether there is any syntax errors in the TNSNAMES.ORA mainly focus the paranthesis is correctly closed or not if there is any errors in the file and that line is not referred.

SOLUTION IF YOU ARE USING Easy connect naming:
>check whether the host, port and service name specified are correct or not.
>check that "EZCONNECT" is listed as one of the values of the NAMES.DIRETORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).
> enclosing the connect identifier in quote marks thats will be better.

Thanks
A.T.J

Thursday, July 16, 2009

Solution for-ORA-00001:unique constraint (string.string) violated

SOLUTION:
This Error will Throw when you violate the unique constraint on the table .because if you created the unique constraint for the table it wont allow you to insert/update the duplicate values into the table.

the following example explains how this error happen.

Employee
------------------------------------------------------------------
NAME AGE DEPT EMP_NO
------------------------------------------------------------------
PIETER 25 SALES 10
JOHN 30 ACCOUNTS 11
RITCHIE 30 SALES 12

The above Employee table contains 3 records and if i create the unique constraint for this Employee table on EMP_NO column or if the unique constraint is already created .......

SYNTAX FOR CREATE UNIQUE CONSTRAINT:

ALTER TABLE table_name add CONSTRAINT constraint_name UNIQUE (column1, column2, ... column_n);

FOR THE ABOVE EXAMPLE CONSTRAINT IS :

ALTER TABLE Employee add CONSTRAINT EmpNo_unique UNIQUE (EMP_NO);

Note:

Here EmpNo_unique is the constraint name

in this Scenario if we insert/update the duplicate values in to the table

For Insert:Insert into Employee(NAME,AGE ,DEPT, EMP_NO)values('JOLIE',25,'SALES',10);

For Update:Update Employee set EMP_NO=12 where EMP_NO=11

For the above two Scenario it will throw the Error as

ORA-00001:unique constraint (Db_Name.EmpNo_unique ) violated

So if you want to overcome with this Error in 2 ways.
1.don't insert/update the duplicate the values in to the table
2.Else Drop the unique constraint

Syntax for Drop the unique Constraint:

ALTER TABLE table_name drop CONSTRAINT constraint_name;

Example:

ALTER TABLE Employee drop CONSTRAINT EmpNo_unique;


Thanks
A.T.J





Wednesday, July 15, 2009

Make Textbox hidden/visible based on the DropDown selection using JavaScript

SOLUTION:

the following function will help you to solve this ......


function hideTextBox(dropDown1){
var valFromDropDown = dropDown1.value;
if(valFromDropDown == 'WRITE'){
document.forms[0].textBox1.style.visibility = "";
} else{
document.forms[0].textBox1.style.visibility = "hidden";
}
}


in the above example hideTextBox is the function name .....
and the input for this function is dropDown value selected......
in this example we are hiding the the text box if the drop down value is 'WRITE' else it will show the textbox......



the following Example.jsp page will clearly explain you how to implement this and please ignore this Symobl(--)inside the every tag Starting. i put this (--) for displaying html tags only kindly ignore that symbol

Example.jsp(please ignore this(--)symbol and try it it will surely work
--------------------------------------------------------------------
<--%@taglib uri="/includes/struts-html.tld" prefix="html"%>
<--%@taglib uri="/includes/struts-bean.tld" prefix="bean"%>
<--%@taglib uri="/includes/struts-logic.tld" prefix="logic"%>



<--script language="javascript">

function hideTextBox(dropDown1){
var valFromDropDown = dropDown1.value;
if(valFromDropDown == 'WRITE'){
document.forms[0].textBox1.style.visibility = "";
} else{
document.forms[0].textBox1.style.visibility = "hidden";
}
}

<--/script>




<--table width="100%" border="0" cellspacing="0" cellpadding="0">

<--tr>
<--td width="20%">SelectProcess:
<--td width="30%">
<--html:select property="dropDown1" onchange="javascript:hideTextBox(this)">
<--html:option value="READ">Read
<--html:option value="WRITE">Write
<--html:option value="OVERWRITE">OverWrite
<--/html:select>
<--td width="20%">
<--td width="30%">
<--/tr>

<--tr>
<--td width="20%">TextBox1:
<--td width="30%">
<--td width="30%"><--html:text property="textBox1" maxlength="10" size="10">
<--/td>
<--td width="20%">
<--td width="30%">

<--/table>

<--/html:html>
--------------------------------------------------------------------------------------
from the above Example.jsp you can clearly understood how the function is implemented

note:

you have to declare these property in the form bean this is the example used in struts Frame work.

if you still having doubts write a comment on this.

Thanks
A.T.J

How to create a .bat file for eclipse


SOLUTION:
the reason for create the .bat file for eclipse is you can give the different versions of java like java 1.4.2 ......java 1.5.0 ...etc..but you can able to give only one version of java at a time.

using this .bat file you can double click it and run the eclipse on desktop.

steps to create the .bat file

1.open a notepad and paste the following things.

start eclipse -vm C:\java\jdk1.4.2\jre\bin\javaw -vmargs -Xmx256M
startup
exit

2.finally save the file name as eclipse.bat and the file type as AllFiles and the location is where the eclipse.exe is located and create the the shortcut for that .bat file just by right click it and select the option CreateShortcut.


Note:
you have to mention the java folder path where its actually located and the exact javaw.exe path
in our example the path is C:\java\jdk1.4.2\jre\bin\javaw


finally the shortcut .bat file will be look like this


Thanks
A.T.J

How to get the duplicate values from table using sql

SOLUTION :

SELECT * from TABLE_NAME a where rowid not in (select max(rowid) from TABLE_NAME b
where a.COLUMN_NAME=b.COLUMN_NAME)

above query retrieves the duplicated values from the table now we can see with the example

BOOK
---------------------------------------------
BOOK_NAME PRICE AUTHOR
--------------------------------------------
JAVA 200 XXXX
LEARNING C 100 YYYY
JAVA 150 ZZZZ
C# 180 AAAA
C++ 200 BBBB
JAVA 200 XXXX
C# 150 RRRR
ORACLE 300 UUUU
PHP 100 EEEE

in the above BOOK table BOOK_NAME is column name here the JAVA and C# gets duplicated .
from this if you want to get duplicated value based on the column name .use the following query

SELECT * from BOOK a where rowid not in (select max(rowid) from BOOK b
where a.BOOK_NAME=b.BOOK_NAME)

after execute this query you will get the following values ,which is the highest of records from duplicated values.

---------------------------------------------
BOOK_NAME PRICE AUTHOR
---------------------------------------------
JAVA 200 XXXX
JAVA 150 ZZZZ
C# 180 AAAA

thanks...
A.T.J

Monday, July 13, 2009

Solution for-ORA-01427:single-row subquery returns more than one row

SOLUTION 1:
the main reason for this error is records get duplicated on the table .So the inner query returns the duplicated values.to rectify this use the following query and this problem get resolved.
here is the solution if and only if you want to delete the duplicate records from the table


DELETE FROM TABLE_NAME A where rowid not in (select max(rowid) from TABLE_NAME B
where A.COLUMN_NAME=B.COLUMN_NAME)

In This QUERY you will replace the TABLE_NAME in to your table name and the COLUMN_NAME into your column name ,where the column datas gets repeated.

SOLUTION 2:
if the inner query returns the duplicated value if you group it on the outer query using the follwing keywords it will rectified.

KEWORDS:ANY, ALL, IN, or NOT IN

Example:

1.SELECT book_name FROM library WHERE book_name IN (SELECT book_name from stores where author_name='dennis ritchie')

2.SELECT book_name FROM library WHERE book_name = ANY (SELECT book_name from stores where author_name='dennis ritchie')

3.SELECT book_name FROM library WHERE book_name = ALL (SELECT book_name from stores where author_name='dennis ritchie')

4.SELECT book_name FROM library WHERE book_name NOT IN (SELECT book_name from stores where author_name='dennis ritchie')


thanks,
A.T.J