NBS Posted July 15, 2008 Author Report Share Posted July 15, 2008 Tojest 2000 :D Link to comment Share on other sites More sharing options...
andrisp Posted July 15, 2008 Report Share Posted July 15, 2008 Dari šitā: SELECT s.street , (SELECT TOP 1 id FROM streets WHERE street = s.street ORDER BY id ASC) as id FROM streets s GROUP BY s.street; Link to comment Share on other sites More sharing options...
NBS Posted July 15, 2008 Author Report Share Posted July 15, 2008 Man, šķiet, ka es stulbs esmu, bet man nesanāk :( Link to comment Share on other sites More sharing options...
andrisp Posted July 15, 2008 Report Share Posted July 15, 2008 Ko nozīmē "nesanāk" ? Link to comment Share on other sites More sharing options...
NBS Posted July 15, 2008 Author Report Share Posted July 15, 2008 Man jāpārveidot savs sql uz to, lai strādātu, man rādas kļūdas: <% query = "SELECT s.streetID AS value, s.NAME AS text FROM streets AS s "; if ((new String(Request("microregion"))) != "undefined") { query += " LEFT JOIN Buildings AS b ON b.street_ID = s.streetID WHERE b.mkregion = "+ Request("microregion") +" OR s.streetID NOT IN (SELECT streetID FROM Buildings)"; } query += " GROUP BY s.streetID, s.NAME ORDER BY s.NAME"; exe = runSQL(query); while (exe.Eof != true) { Response.Write("<option value="+ exe("value") +">"+ exe("text") +"</option>"); exe.MoveNext(); } %> Link to comment Share on other sites More sharing options...
Gints Plivna Posted July 15, 2008 Report Share Posted July 15, 2008 (edited) Man starp citu sanāk ļoti labi, nu jāpieliek vēl klāt order by klauza, lai dabūtu vajadzīgajā kārtībā, ja tā ir svarīga. Tā kā tiešām kas nesanāk? Un ja nesanāk, tad kļūdas paziņojumu vai jebkādu citu info, jo citādi nu nekas nav saprotams. Uzraksti to selektu takš bez tiem drausmīgajiem tagiem, dabū, lai tas strādā tāopat un tad dinamiski formē viņu vai kas nu tev tur nepieciešams... Ā BTW es jau šito arī protam pārbaudīju uz 2005 varbūt 2000 arī inline views nebija iespējami.... Gints Plivna http://datubazes.wordpress.com Edited July 15, 2008 by Gints Plivna Link to comment Share on other sites More sharing options...
NBS Posted July 15, 2008 Author Report Share Posted July 15, 2008 Ai, jāiet kārties svc. Link to comment Share on other sites More sharing options...
NBS Posted July 16, 2008 Author Report Share Posted July 16, 2008 Palīdziet, lūdzu, joprojām šis pats murgs, kuru nevaru atrisināt: Ir ēka, kurai ir piesaistītas ielas: //selekts, kur visi piesaistītie SELECT DISTINCT s.streetID AS value, s.NAME AS text FROM streets AS s INNER JOIN Buildings AS b ON b.street_ID = s.streetID WHERE b.mkregion = '95' ORDER BY s.NAME //selekts, kur visi nepiesaistītie bet šeit viņi atkārtojas SELECT s.streetID AS value, s.NAME AS text FROM streets AS s WHERE s.streetID NOT IN (SELECT street_ID FROM Buildings) ORDER BY s.NAME 1. Vēlos, lai select's ar nepiesaistītie s.Name ieraksti neatkārtojas; 2. Vēlos šos abus selektus apvienot vienā, lai norādot ēku man atlasās piesaistītie un tos, kas nav piesaistīti. Esmu izveidojis šādu selectu: SELECT DISTINCT s.streetID AS value, s.NAME AS text FROM streets AS s INNER JOIN Buildings AS b ON b.street_ID = s.streetID WHERE b.mkregion = '95' OR s.streetID NOT IN (SELECT street_ID FROM Buildings) ORDER BY s.NAME Atlasa visus ierakstus, kas piesaistīti pie šīs ēkas kā arī nepiesaistītos, bet šie nepiesaistītie man atkārtojas un ir vairāki, vēlos, lai nerāda, atkārtotos pie nepiesaistītajām ielām. Būšu ļoti pateicīgs, ja palīdzēsiet. Link to comment Share on other sites More sharing options...
Gints Plivna Posted July 16, 2008 Report Share Posted July 16, 2008 CREATE TABLE skripti? Piemēra dati kā INSERT INTO .. VALUES? Nepieciešamais rezultāts formatētā veidā, lai var saprast izmantojot (code tagu)? Gints Plivna http://datubazes.wordpress.com Link to comment Share on other sites More sharing options...
Recommended Posts