SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 and operation on single columns
 New Topic  Reply to Topic
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

spirit1
Cybernetic Yak Master

Slovenia
11751 Posts

Posted - 02/14/2007 :  09:27:38  Show Profile  Visit spirit1's Homepage  Reply with Quote
this whole thing is ridicolous.

you have to use OR to get a resultset.
then pivot that if needed.



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30281 Posts

Posted - 02/14/2007 :  09:50:40  Show Profile  Visit SwePeso's Homepage  Reply with Quote
See http://www.sqlteam.com/forums/topic.asp?whichpage=1&TOPIC_ID=79114#287425


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

spirit1
Cybernetic Yak Master

Slovenia
11751 Posts

Posted - 02/14/2007 :  10:17:43  Show Profile  Visit spirit1's Homepage  Reply with Quote
oh.. i saw...
i just thought that saying it again is neccesary



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
37316 Posts

Posted - 02/14/2007 :  13:34:07  Show Profile  Visit tkizer's Homepage  Reply with Quote
How absolutely ridiculous! Just because you can do it with AND using a self join doesn't mean that you should be doing this. And I know Peter isn't suggesting to use his solution, he's just satisfying the poster's ridiculous need to use AND.

Use OR and be done with it. Tell your teacher he is an idiot if he wants a solution with AND.

Tara Kizer
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

USA
7020 Posts

Posted - 02/14/2007 :  13:44:46  Show Profile  Reply with Quote
If you really must have an AND:
where (Platform in ('C++','Java')) and (Platform in ('Java','C++'))


CODO ERGO SUM
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30281 Posts

Posted - 02/14/2007 :  15:02:10  Show Profile  Visit SwePeso's Homepage  Reply with Quote
quote:
Originally posted by tkizer

And I know Peter isn't suggesting to use his solution, he's just satisfying the poster's ridiculous need to use AND.
You could tell?



Peter Larsson
Helsingborg, Sweden
Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17681 Posts

Posted - 02/14/2007 :  17:49:20  Show Profile  Reply with Quote
quote:
Originally posted by Michael Valentine Jones

If you really must have an AND:
where (Platform in ('C++','Java')) and (Platform in ('Java','C++'))


CODO ERGO SUM



Good solution.


KH

Go to Top of Page

byrmol
Shed Building SQL Farmer

Australia
1591 Posts

Posted - 02/14/2007 :  19:43:19  Show Profile  Reply with Quote
The poster is after a relational DIVISION operation.

But I think that concept is way over his head...



DavidM

Production is just another testing cycle
Go to Top of Page

vsureshbabu
Starting Member

India
10 Posts

Posted - 02/15/2007 :  00:21:24  Show Profile  Reply with Quote
Thank u
Peter Larsson
Helsingborg, Sweden
I am very glad to say thankful to u.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30281 Posts

Posted - 02/15/2007 :  02:57:06  Show Profile  Visit SwePeso's Homepage  Reply with Quote
quote:
Originally posted by khtan

quote:
Originally posted by Michael Valentine Jones

where (Platform in ('C++','Java')) and (Platform in ('Java','C++'))

Good solution.
Not if you want C++ and Java exclusively. What if a Emp only have Java? Then the statement is TRUE anyway...


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30281 Posts

Posted - 07/02/2010 :  17:17:29  Show Profile  Visit SwePeso's Homepage  Reply with Quote
Also see http://weblogs.sqlteam.com/peterl/archive/2010/07/02/Proper-Relational-Division-With-Sets.aspx



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.17 seconds. Powered By: Snitz Forums 2000