By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,234 Members | 1,823 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,234 IT Pros & Developers. It's quick & easy.

SQL Problem

P: n/a
Hello

I would like to obtain all the fields of a table where the two fields C1 and
C2 from this table are distinct, what is the request ? I can't find it ...
sorry, and thank you
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
lavasseur patrick wrote:
I would like to obtain all the fields of a table where the two fields C1 and
C2 from this table are distinct, what is the request ?


Does this do what you want?

SELECT *
FROM table
WHERE C1 <> C2

or do you have Nulls in there to mess things up?

--
Marsh
Nov 12 '05 #2

P: n/a
lavasseur patrick wrote:
I would like
C1 C2 C3
---------- ---- ----
VINET 5 10
VINET 5 11
VINET 5 12
TOMSP 5 13
TOMSP 5 13
TOMSP 6 18
TOMSP 7 19
TOMSP 6 19
TOMSP 7 18


and to obtain
C1 C2 C3
---------- ---- ----
VINET 5 10
TOMSP 5 13


for the result

what should be the request ?


Sorry, but I can't see a distinction between
TOMSP 5 13
and
TOMSP 6 18
that is consistent with whatever made
VINET 5 10
a desired member of your result set.

Could you explain the logic you're using to decide which
records should and should not be in the desired result set.

--
Marsh
Nov 12 '05 #3

P: n/a
On Wed, 3 Sep 2003 01:44:44 +0200 in comp.databases.ms-access,
"lavasseur patrick" <pl**********@hotmail.com> wrote:
I would like
C1 C2 C3
---------- ---- ----
VINET 5 10
VINET 5 11
VINET 5 12
TOMSP 5 13
TOMSP 5 13
TOMSP 6 18
TOMSP 7 19
TOMSP 6 19
TOMSP 7 18


and to obtain
C1 C2 C3
---------- ---- ----
VINET 5 10
TOMSP 5 13


for the result

what should be the request ?


Looks like you want to group by C1 and use First() or Min() on the
others.

--
A)bort, R)etry, I)nfluence with large hammer.

(replace sithlord with trevor for email)
Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.