Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Niepoprawne zapytanie grupujące
adas007
post 19.01.2010, 00:27:06
Post #1





Grupa: Zarejestrowani
Postów: 72
Pomógł: 0
Dołączył: 9.03.2007

Ostrzeżenie: (0%)
-----


Witajcie,
W ramach treningu sql'a robię sobie ćwiczenia proponowane na Wikipedii tutaj też jest podana tabela do zapytania: http://en.wikibooks.org/wiki/SQL_Exercises...#Sample_dataset
  1. SELECT AVG(Price), Manufacturers.Name
  2. FROM Products INNER JOIN Manufacturers
  3. ON Products.Manufacturer = Manufacturers.Code
  4. GROUP BY Manufacturers.Name;


Używam ms sql server'a 2005 i wyrzuca takie info o błędzie:

Msg 306, Level 16, State 2, Line 1
The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator


Ten post edytował adas007 19.01.2010, 00:30:43
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
Gapollo
post 19.01.2010, 21:59:51
Post #2





Grupa: Zarejestrowani
Postów: 33
Pomógł: 5
Dołączył: 2.11.2006
Skąd: 52.259 °N, 21.020 °E

Ostrzeżenie: (0%)
-----


Zmień typ pola Manufacturers.Name na varchar. Tutaj typ Text służy do przechowywania książek winksmiley.jpg


--------------------
Aktualny projekt: Egipt - Dahab
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 23.06.2025 - 00:01