473,385 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Probs In Query

TABLE FIRST
Create table student1(roll int,marks int)
insert into student1 values(1,10)
insert into student1 values(2,20)
insert into student1 values(3,30)


TABLE SECOND
create table info(roll int,addr varchar(10))
insert into info values(1,'Delhi')
insert into info values(2,'Fbd')
insert into info values(4,'Gurgaon')


1)select info.roll from info ,student1 where info.roll=student1.roll
ANSWER IS RIGHT
1
2

2)select info.roll from info ,student1 where info.roll <> student1.roll
ANSWER is supposed to be Only Roll No 4.
But the result is coming out Different......
Mar 19 '08 #1
1 902
ck9663
2,878 Expert 2GB
TABLE FIRST
Create table student1(roll int,marks int)
insert into student1 values(1,10)
insert into student1 values(2,20)
insert into student1 values(3,30)


TABLE SECOND
create table info(roll int,addr varchar(10))
insert into info values(1,'Delhi')
insert into info values(2,'Fbd')
insert into info values(4,'Gurgaon')


1)select info.roll from info ,student1 where info.roll=student1.roll
ANSWER IS RIGHT
1
2

2)select info.roll from info ,student1 where info.roll <> student1.roll
ANSWER is supposed to be Only Roll No 4.
But the result is coming out Different......
Try WHERE NOT EXISTS or WHERE NOT IN

-- CK
Mar 19 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: agherring | last post by:
Hi, We've just started evaluating the Data Direct ODBC Oracle driver and comparing performance with Oracle's own driver in a development project we're undertaking. We have struck a problem -...
1
by: Arijit Chatterjee | last post by:
Hi Everybody, I am facing another probs. I have created a trigger for table Tab1 for perticular column col1 for checking value ranges.But at time for using insert statement it is working fine but...
2
by: andrewcw | last post by:
Seems it should be simple. I had problems with a larger class and the newsgroup suggested something I also tried. So I pruned my class to see if I could find out what could be wrong, Still dont...
3
by: iksrazal | last post by:
Hi all, I'm hoping someone on this forum can help me. I use hibernate with java to access mysql. We are trying to upgrade from 4.1.15 non-inndb, to 5.0.18 with innodb. Hibernate makes a 'create...
1
by: Peter Newman | last post by:
ok this is getting far to technical for me now .. lol thank you all for the help yesterday, however im still stumbling on one bit ... heres my code so far Dim InputString() As String Dim...
1
by: Graham Feeley | last post by:
I have a date field named rcdate it is a general date eg: 12/08/2006 3:30:00 PM 12/08/2006 3:00:00 PM I used to update another empty field named rdate with the with using in a update query "...
7
by: dlowry | last post by:
I need help here... I have created a list box (LstCName) from a form named (contactlist) that picks up employee names from a query named (lkpcontacts). The employee names are displayed fine but when...
7
by: polecat | last post by:
Im new to .NET and I am having probs with this Every time I reload the form the same data is repeated again.... Done reading on msdn and another forum cant figure out why the...
0
by: bkpatel | last post by:
get Join the PHP community and share ur probs - soln <table border=0 style="background-color: #fff; padding: 5px;" cellspacing=0> <tr><td> <img...
2
by: brettokumar | last post by:
hai im storing value in cookies. if my 2nd value or 3rd value is stored means my previous cookies are expired my current cookies only stored others cookies values will be null how to i solve...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.