Your SQL command was:
 SELECT TOP 100 s1.objID as s1, s2.objID as s2 
 FROM Star AS S1 
 JOIN Neighbors AS N ON S1.objID = N.objID 
 JOIN Star AS S2 ON S2.objID = N.NeighborObjID 
 WHERE 
 N.NeighborType = dbo.fPhotoType('Star') 
 and N.distance < .05 
 and ((S1.u - S1.g) < 0.4 ) 
 and (S1.g - S1.r) < 0.7 
 and (S1.r - S1.i) > 0.4 
 and (S1.i - S1.z) > 0.4 

Your query output (max 500,000 rows):

s1s2
12376517572113877721237651757211387779
12376517572113214441237651757211321441
12376517572113214441237651757211321414
12376517572111269611237651757211126955
12376517572111254661237651757211125422
12376517577484535261237651757748453491
12376517572109995201237651757210999519
12376517572109988621237651757210998861
12376517572114554221237651757211455414
12376517572114553061237651757211455303
12376517572114552811237651757211455269
12376517572111912811237651757211191266
12376590887197102411237659088719710269
12376590887196465591237659088719646553
12376590887196453831237659088719645379
12376590887196437491237659088719643732
12376590887195772661237659088719577262
12376517572109989941237651757210998995
12376590897930593471237659089793059338
12376590892567799771237659089256779973
12376590892567791201237659089256779115
12376590892565150561237659089256515058
12376590892567762071237659089256776212
12376590892564485671237659089256448562
12376517582849317331237651758284931709
12376517572111934191237651757211193422
12376517572111928951237651757211192890
12376590892562536071237659089256253610
12376590892562536071237659089256253601
12376590892562517931237659089256251789
12376517582852639811237651758285263980
12376517582852639271237651758285263925
12376590897935864421237659089793586441
12376590897935864421237659089793586439
12376517588220010201237651758822001016
12376517582852606861237651758285260684
12376517588219393101237651758821939311
12376517588219373861237651758821937380
12376517588219361971237651758821936190
12376517572111938011237651757211193807
12376590897931230921237659089793123111
12376517577479323431237651757747932330
12376517588218057371237651758821805744
12376590892565158451237659089256515842
12376517577482613911237651757748261388
12376517582847396961237651758284739695
12376517577484535191237651757748453465
12376517577481277881237651757748127785
12376517577481258721237651757748125846
12376517577478688991237651757747868898
12376517582848024101237651758284802405
12376517577484536181237651757748453605
12376517577479984831237651757747998465
12376517577478668811237651757747866879
12376517577478668811237651757747866878
12376517582848011361237651758284801126
12376517577479973861237651757747997382
12376517577479965441237651757747996526
12376517577478650871237651757747865075
12376517577478649891237651757747864960
12376517577479954161237651757747995415
12376517577481948351237651757748194834
12376517572111912151237651757211191201
12376517577481937111237651757748193725
12376517577481937111237651757748193703
12376517577481937241237651757748193715
12376517577477982201237651757747798182
12376517572114523591237651757211452353
12376517572114519031237651757211451890
12376517577477983071237651757747798301
12376517572113863731237651757211386360
12376517572113269321237651757211326931
12376517572114546561237651757211454647
12376517572113208131237651757211320812
12376517572111960971237651757211196098
12376517572111952931237651757211195292
12376517572111286751237651757211128667
12376517572111269611237651757211126977
12376517572111262671237651757211126275
12376517572111262671237651757211126272
12376517572114547411237651757211454734
12376517572111247391237651757211124753
12376517572111244881237651757211124462
12376517572114549591237651757211454912
12376517572111237821237651757211123805
12376517572115846851237651757211584674
12376517572114579661237651757211457965
12376517572114578961237651757211457897
12376517572109992131237651757210999214
12376517572114549601237651757211454954
12376517572114549601237651757211454961
12376517577477985671237651757747798561
12376517572109983951237651757210998394
12376517577477988221237651757747798820
12376517577477989871237651757747798982
12376517572109957641237651757210995766
12376517572109957641237651757210995761
12376517572109956041237651757210995595
12376517572114550481237651757211455041
12376517572109952651237651757210995254