Recent PostsRecent Posts Popular TopicsPopular Topics
 Home Search Members Calendar Who's On

 Divided Operator Rate Topic Display Mode Topic Options
Author
 Message
 Posted Friday, July 24, 2009 4:16 AM
 Forum Newbie Group: General Forum Members Last Login: Thursday, January 21, 2010 12:29 PM Points: 4, Visits: 166
 How do we implement DIVIDE OPERATOR in SQL?
Post #758915
 Posted Friday, July 24, 2009 12:36 PM
 Valued Member Group: General Forum Members Last Login: Friday, April 02, 2010 6:41 AM Points: 54, Visits: 134
Post #759415
 Posted Friday, July 24, 2009 1:11 PM
 SSChampion Group: General Forum Members Last Login: 2 days ago @ 4:09 PM Points: 10,810, Visits: 12,339
 If you meant the math division operator then you use "/". Jack CorbettApplications Developer Don't let the good be the enemy of the best. -- Paul FlemingCheck out these links on how to get faster and more accurate answers: Forum Etiquette: How to post data/code on a forum to get the best helpNeed an Answer? Actually, No ... You Need a QuestionHow to Post Performance ProblemsCrosstabs and Pivots or How to turn rows into columns Part 1Crosstabs and Pivots or How to turn rows into columns Part 2
Post #759451
 Posted Friday, July 24, 2009 2:08 PM
 Forum Newbie Group: General Forum Members Last Login: Thursday, January 21, 2010 12:29 PM Points: 4, Visits: 166
 stopitallready (7/24/2009)What are you trying to do? More information is neccessary.EliI mean 8th operator. A divided by B per C and A,B and C are result set.A divided by B per C = A minus ( (A times B) minus C)
Post #759493
 Posted Friday, July 24, 2009 4:54 PM
 SSChampion Group: General Forum Members Last Login: Yesterday @ 2:58 PM Points: 12,332, Visits: 29,575
 still not clear to me either, can you give a non-pseudo code, concrete example of the expected results? Lowell--There is no spoon, and there's no default ORDER BY in sql server either.Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #759548
 Posted Friday, July 24, 2009 5:04 PM
 SSC Eights! Group: General Forum Members Last Login: Yesterday @ 4:42 PM Points: 875, Visits: 6,440
 If you're talking about the relational division operator, a decent explanation with some SQL as an example is http://www.dbazine.com/ofinterest/oi-articles/celko1.I'm not a big Celko fan, but this (and the included references) should get you started. And then again, I might be wrong ...David Webb
Post #759551
 Posted Saturday, July 25, 2009 3:02 AM
 SSC-Addicted Group: General Forum Members Last Login: Thursday, December 05, 2013 3:21 PM Points: 419, Visits: 2,976
 Take a look at Vadim Tropashko's book SQL Design Patterns for examples of relational division problems and solutions.Full marks for a good question by the way. It's a bit unfortunate that Relational Algebra and other relational theory ideas aren't as well appreciated and used in the SQL community as they perhaps ought to be. These concepts give you the tools and a vocabulary for solving lots of every day problems.Unfortunately, as has often been noted, too many database practitioners today don't know the relational model at all. They just know SQL and someone once told them SQL was relational so they assume they must know the relational stuff too.Not knocking anyone here BTW. Just my thoughts for this "Relational Theory" forum.Hope this helps. David
Post #759598
 Posted Saturday, July 25, 2009 3:36 AM
 Forum Newbie Group: General Forum Members Last Login: Thursday, January 21, 2010 12:29 PM Points: 4, Visits: 166
 Thank you.I agree with you. a lot of difficult problem solve by using relational algebra.Dr. CJ Date offered two methods but I was looking for the best solution for division operator.here is a method: Please exec following script before exec this query-- My MethodSELECT DISTINCT pilotFROM PilotSkills AS PSWHERE NOT EXISTS ( SELECT plane FROM Hangar EXCEPT SELECT plane FROM PilotSkills WHERE PS.pilot=pilot )/*CREATE TABLE PilotSkills (pilot CHAR(15) NOT NULL, plane CHAR(15) NOT NULL, PRIMARY KEY (pilot, plane)); INSERT INTO PilotSkillsSELECT pilot='Celko', plane='Piper Cub'UNIONSELECT 'Higgins','B-52 Bomber'UNIONSELECT 'Higgins','F-14 Fighter'UNIONSELECT 'Higgins','Piper Cub'UNIONSELECT 'Jones','B-52 Bomber'UNIONSELECT 'Jones','F-14 Fighter'UNIONSELECT 'Smith','B-1 Bomber'UNIONSELECT 'Smith','B-52 Bomber'UNIONSELECT 'Smith','F-14 Fighter'UNIONSELECT 'Wilson','B-1 Bomber'UNIONSELECT 'Wilson','B-52 Bomber'UNIONSELECT 'Wilson','F-14 Fighter'UNIONSELECT 'Wilson','F-17 Fighter'CREATE TABLE Hangar(plane CHAR(15) NOT NULL PRIMARY KEY);INSERT INTO HangarSELECT plane='B-1 Bomber'UNIONSELECT 'B-52 Bomber'UNIONSELECT 'F-14 Fighter'*/
Post #759600

 Permissions