art
01-05-2001, 10:00 AM
Hi, i have a few question about the SQL of sql server 7.0
I whant to use column alias, here a complete exemple of what i have in mind
:
select exas_no , cours_titre from exaset,cours where exas_nocours=cours_no
I add a column :
select exas_no ,exas_nocours , cours_titre from exaset,cours where exas_nocours=cours_no
I add an alias to this column L
select exas_no ,exas_nocours as MyNo , cours_titre from exaset,cours where
exas_nocours=cours_no
Until now everything work correctly. But when i try to re-use that alias...
boom
select exas_no ,exas_nocours as MyNo , cours_titre from exaset,cours where
MyNo=cours_no
here the error :
Server: Msg 207, Level 16, State 3, Line 1
Invalid column name 'MyNo'.
Can someone help me on this matter please ?
I whant to use column alias, here a complete exemple of what i have in mind
:
select exas_no , cours_titre from exaset,cours where exas_nocours=cours_no
I add a column :
select exas_no ,exas_nocours , cours_titre from exaset,cours where exas_nocours=cours_no
I add an alias to this column L
select exas_no ,exas_nocours as MyNo , cours_titre from exaset,cours where
exas_nocours=cours_no
Until now everything work correctly. But when i try to re-use that alias...
boom
select exas_no ,exas_nocours as MyNo , cours_titre from exaset,cours where
MyNo=cours_no
here the error :
Server: Msg 207, Level 16, State 3, Line 1
Invalid column name 'MyNo'.
Can someone help me on this matter please ?