Welcome to dbFreaks.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Sql puzzle

 
   Database Help (Home) -> General Discussions RSS
Next:  Go to portal row -- dialog??  
Author Message
SG

External


Since: Nov 13, 2003
Posts: 4



(Msg. 1) Posted: Fri Feb 11, 2005 9:18 am
Post subject: Sql puzzle
Archived from groups: comp>databases>ms-sqlserver (more info?)

Hi all,
  I have a sql puzzle (which I've solved) but seems very unwieldy. Is
there a more efficient way of doing this?
  It reads like so:
SELECT a.*
FROM axindex a INNER JOIN
axindex b ON a.id4 = b.id4 AND a.id1 = b.id1 AND
a.id5 = b.id5 AND a.conflict_type = b.conflict_type INNER JOIN
axindex c ON b.id4 = c.id4 AND b.id1 = c.id1 AND
b.id5 = c.id5 AND b.conflict_type = c.conflict_type INNER JOIN
axindex d ON c.id4 = d.id4 AND c.id1 = d.id1 AND
c.id5 = d.id5 AND c.conflict_type = d.conflict_type
WHERE (a.stext = 'land') AND (b.stext = 'reg') AND (c.stext =
'fees') AND (a.conflict_type = 5) AND (d.stext = 'hamilton')


Many thanks in advance.
Sam<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Sql puzzle 
Back to top
Login to vote
David Portas

External


Since: Nov 11, 2003
Posts: 854



(Msg. 2) Posted: Fri Feb 11, 2005 9:21 am
Post subject: Re: Sql puzzle [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Replied in microsoft.public.sqlserver.programming. Please do not post
the same question independently to different groups.

--
David Portas
SQL Server MVP
--

 >> Stay informed about: Sql puzzle 
Back to top
Login to vote
Display posts from previous:   
   Database Help (Home) -> General Discussions All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]