errore in creazione tabella | SQL & MySQL

Topic: Pubblico - Composto da 6 Posts di 2 Utenti.

21 Dicembre, 2011 11:31 #1
ffabio75
Utente

ffabio75
Registrato: Dec, 2011
Posts: 8
Offline

Buongiorno a tutti,
non riesco a capire perchè mi viene non mi funziona questa create table, se provo solo la select funziona è per via del group by ??

create table xxx (
AS (select cod_prest FROM t_amb_vert
WHERE (data_fine_erog >= '10112011' AND data_fine_erog >= '10112011')
OR (data_fine_erog >= '22112011' AND data_fine_erog >= '22112011')
group by cod_prest
order by cod_prest));

grazie

21 Dicembre, 2011 11:55 #2
re-verse
Moderatore

re-verse
Registrato: Jul, 2008
Posts: 312
Offline

Ciao,
la select da sola ti funziona?


Salvatore DC

La mente è come un paracadute: funziona solo se si apre. A.Einstein.

21 Dicembre, 2011 13:02 #3
ffabio75
Utente

ffabio75
Registrato: Dec, 2011
Posts: 8
Offline

si da sola funziona.
senza problemi è quando la inserisco nella create table
che non va

21 Dicembre, 2011 13:05 #4
ffabio75
Utente

ffabio75
Registrato: Dec, 2011
Posts: 8
Offline

mi restituisce questo errore:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS select cod_prest FROM t_amb_vert
WHERE (data_fine_erog >= '10112011' AND' at line 2

21 Dicembre, 2011 13:49 #5
ffabio75
Utente

ffabio75
Registrato: Dec, 2011
Posts: 8
Offline

trovato era la parentesi

create table xxx (

non ci vogliono

21 Dicembre, 2011 14:04 #6
re-verse
Moderatore

re-verse
Registrato: Jul, 2008
Posts: 312
Offline

giusto :)


Salvatore DC

La mente è come un paracadute: funziona solo se si apre. A.Einstein.

Condividi su:

Loggati o Registrati per replicare