| Author |
Topic  |
|
|
manners
Starting Member
1 Posts |
Posted - 10/04/2012 : 03:53:47
|
Hi, I need help with a join. Relatively new to SQL.Any help greatly appreciated.Here's the code:
set identity_insert idx_ref_attribute_type on go
Insert into idx_ref_attribute_type (idx_attribute_type_id, type_desc, value_type, daily_change, purpose)
Select idx_factor_type_id, factor_type_desc, factor_value_type, daily_change, factor_purpose
From idx_factor_type
inner join idx_attribute_type
on idx_ref_attribute_type.membershp_attribute = idx_attribute_type.membership_attribute
set identity_insert idx_ref_attribute_type off
The error I get is: [Error] Script lines: 3-23 ------------------------- The column prefix 'idx_ref_attribute_type' does not match with a table name or alias name used in the query. Either the table is not specified in the FROM clause or it has a correlation name which must be used instead.
Without the inner join and following line it works perfectly! =(
Cheers |
|
|
webfred
Flowing Fount of Yak Knowledge
Germany
8515 Posts |
Posted - 10/04/2012 : 04:15:19
|
I only could answer like this: The column prefix 'idx_ref_attribute_type' does not match with a table name or alias name used in the query. Either the table is not specified in the FROM clause or it has a correlation name which must be used instead.
Too old to Rock'n'Roll too young to die. |
 |
|
|
bandi
Flowing Fount of Yak Knowledge
India
1451 Posts |
Posted - 10/04/2012 : 05:10:04
|
quote: Originally posted by manners
Hi, I need help with a join. Relatively new to SQL.Any help greatly appreciated.Here's the code:
set identity_insert idx_ref_attribute_type on go
Insert into idx_ref_attribute_type (idx_attribute_type_id, type_desc, value_type, daily_change, purpose)
Select idx_factor_type_id, factor_type_desc, factor_value_type, daily_change, factor_purpose
From idx_factor_type
inner join idx_attribute_type
on idx_ref_attribute_type.membershp_attribute = idx_attribute_type.membership_attribute
set identity_insert idx_ref_attribute_type off
The error I get is: [Error] Script lines: 3-23 ------------------------- The column prefix 'idx_ref_attribute_type' does not match with a table name or alias name used in the query. Either the table is not specified in the FROM clause or it has a correlation name which must be used instead.
Without the inner join and following line it works perfectly! =(
Cheers
Try this one
From idx_factor_type
inner join idx_attribute_type
on idx_factor_type.membershp_attribute = idx_attribute_type.membership_attribute
i think u mistakenly wrote idx_ref_attribute_type
-- Chandu |
 |
|
| |
Topic  |
|
|
|