![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 195 Pomógł: 0 Dołączył: 13.04.2004 Skąd: Łódź Ostrzeżenie: (0%) ![]() ![]() |
Witam
Mam tabelę następującej struktury i treści: Kod +-------+---------+------------+-------------+ | id | owner | name | value | |int(15)| int(7) | char(40) | char(40) | +-------+---------+------------+-------------+ | 1 | 1 | points | 75 | | 2 | 1 | points_add | 150 | | 3 | 1 | points_max | 5000 | | 4 | 1 | costam | jakas_dana | | 5 | 2 | points | 250 | | 6 | 2 | points_add | 150 | | 7 | 2 | points_max | 5000 | | 8 | 3 | points | 4900 | | 9 | 3 | points_add | 250 | | 10 | 3 | points_max | 5000 | | 11 | 4 | points | 5500 | | 12 | 4 | points_add | 250 | | 13 | 4 | points_max | 5000 | | 14 | 4 | costam | jakas_dana | +-------+---------+------------+-------------+ Wywołuję na niej zapytanie
Spodziewany rezultat: Kod +-------+---------+------------+-------------+ | id | owner | name | value | |int(15)| int(7) | char(40) | char(40) | +-------+---------+------------+-------------+ | 1 | 1 | points | 225 | | 2 | 1 | points_add | 150 | | 3 | 1 | points_max | 5000 | | 4 | 1 | costam | jakas_dana | | 5 | 2 | points | 400 | | 6 | 2 | points_add | 150 | | 7 | 2 | points_max | 5000 | | 8 | 3 | points | 5000 | | 9 | 3 | points_add | 250 | | 10 | 3 | points_max | 5000 | | 11 | 4 | points | 5500 | | 12 | 4 | points_add | 250 | | 13 | 4 | points_max | 5000 | | 14 | 4 | costam | jakas_dana | +-------+---------+------------+-------------+ Otrzymany rezultat: Kod +-------+---------+------------+-------------+ | id | owner | name | value | |int(15)| int(7) | char(40) | char(40) | +-------+---------+------------+-------------+ | 1 | 1 | points | 75 | // Tutaj nie podniosło | 2 | 1 | points_add | 150 | | 3 | 1 | points_max | 5000 | | 4 | 1 | costam | jakas_dana | | 5 | 2 | points | 400 | | 6 | 2 | points_add | 150 | | 7 | 2 | points_max | 5000 | | 8 | 3 | points | 5000 | | 9 | 3 | points_add | 250 | | 10 | 3 | points_max | 5000 | | 11 | 4 | points | 5500 | | 12 | 4 | points_add | 250 | | 13 | 4 | points_max | 5000 | | 14 | 4 | costam | jakas_dana | +-------+---------+------------+-------------+ Ktoś wie, skąd się takie coś bierze? |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 195 Pomógł: 0 Dołączył: 13.04.2004 Skąd: Łódź Ostrzeżenie: (0%) ![]() ![]() |
Żadnego błędu. SELECT daje poprawne wyniki (wszystkie pola wybrane)
1. czemu nie zrobisz 4 kolumn w tej tabeli dla points, points_add, points_max, costam? ponieważ costam jest tylko przykładem i tych 'costamów' jest znacznie więcej i są dodawane w sposób nie ciągły (tzn. jedni go mają, inni nie mają, czasami dodają się w wyniku działań usera, itp. (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) )Po zastosownaiu CAST-a problem zniknął. Teraz jestem w kropce - czy mam zgłaszać to jako bug do MYSQL AB? Przecież to zapytanie powinno się wykonać i bez CAST-a Ten post edytował L_Devil 7.08.2006, 12:58:28 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 10.10.2025 - 10:42 |