Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> zapytanie i podzapytanie (..(ORDER BY DESC)ORDER BY ASC ), Every derived table must have its own alias
M44ti
post
Post #1





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 6.04.2012

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


Witam co tu robię źlę ?

  1. SELECT * FROM(
  2. SELECT ts.shout_id, ts.shout_name, ts.shout_message, ts.shout_datestamp, ts.shout_ip, ts.shout_hidden, tu.user_id, tu.user_name, tu.user_avatar, tu.user_level, tu.user_lastvisit, tu.user_status
  3. FROM evo_shoutbox AS ts
  4. LEFT JOIN evo_users AS tu ON ts.shout_name=tu.user_id
  5. WHERE shout_hidden='0'
  6. ORDER BY ts.shout_datestamp DESC LIMIT 0,8
  7. ) ORDER BY shout_datastamp ASC

Cytat
Every derived table must have its own alias


Ten post edytował M44ti 7.04.2012, 14:25:30
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
gothye
post
Post #2





Grupa: Zarejestrowani
Postów: 702
Pomógł: 65
Dołączył: 16.03.2009

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


masz jasny błąd ,wystarczy znajomość języka angielskiego


--------------------
Nie udzielam pomocy poprzez PW
Go to the top of the page
+Quote Post
M44ti
post
Post #3





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 6.04.2012

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


  1. SELECT * FROM(
  2. SELECT ts.shout_id, ts.shout_name, ts.shout_message, ts.shout_datestamp, ts.shout_ip, ts.shout_hidden, tu.user_id, tu.user_name, tu.user_avatar, tu.user_level, tu.user_lastvisit, tu.user_status
  3. FROM evo_shoutbox AS ts
  4. LEFT JOIN evo_users AS tu ON ts.shout_name=tu.user_id
  5. WHERE shout_hidden='0'
  6. ORDER BY ts.shout_datestamp DESC LIMIT 0,8
  7. ) AS sb ORDER BY sb.shout_datastamp ASC


Cytat
Unknown column 'sb.shout_datastamp' in 'order clause'



tutaj tez ale dla mnie nie jest jasny co zle robie :/

ok naprawione

kod działa w tej postaci

  1. SELECT * FROM(
  2. SELECT ts.shout_id, ts.shout_name, ts.shout_message, ts.shout_datestamp, ts.shout_ip, ts.shout_hidden, tu.user_id, tu.user_name, tu.user_avatar, tu.user_level, tu.user_lastvisit, tu.user_status
  3. FROM evo_shoutbox AS ts
  4. LEFT JOIN evo_users AS tu ON ts.shout_name=tu.user_id
  5. WHERE shout_hidden='0'
  6. ORDER BY ts.shout_id DESC LIMIT 0,8
  7. ) AS sb
  8. ORDER BY sb.shout_id ASC


nie wiem czemu ale ts.shout_datestamp nie widziało w 1 zapytaniu

Ten post edytował M44ti 7.04.2012, 16:35:28
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 Aktualny czas: 21.08.2025 - 16:02