| Author |
Topic |
|
werhardt
Constraint Violating Yak Guru
270 Posts |
Posted - 2008-01-03 : 11:28:40
|
| I am having a problem with my joins to make this a flat file. What I want to do is have the address on here 2 times, but one saying Provider office and the other one saying billing office. Can you help me out here. Please take a look at my statement below.Select DistinctPRO_TAX1 as "TaxID",Pro_XTYP as "ProviderType",PRO_Office as "PracticeName",Pro_Lname as "ProviderFirstName",Pro_Fname as "ProviderLastName",Pro_sys as "System affiliate Field367",--val_desc,pro_pcs as PCS#,pro_spec1 as "Specialty1",pro_spec2 as "Specialty2",pro_spec3 as "Specialty3",pro_spec4 as "Specialty4",pro_degree as "ProviderDegree",pro_addr1 as "ProviderAddress1",pro2.pro_addr1 as "BillingAddress1",pro_addr2 as "ProviderAddress2",pro2.pro_addr2 as "BillingAddress2",pro_city as "ProviderCity",pro2.pro_city as "Billing Address2",pro_state as "ProviderState",pro2.pro_state as BillingState,pro_zip as "ProviderZip",pro2.pro_zip as "BillingZip",pro_phone as "ProviderPhone",pro_fax as "ProviderFax",PRO_BTAGpro2.PRO_BTAGFROM dbo.proJOIN pro pro2ON pro2.pro_id1 = pro.pro_id1 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-01-03 : 11:33:03
|
Whats the need of a join here? Cant you achieve it like this:-Select DistinctPRO_TAX1 as "TaxID",Pro_XTYP as "ProviderType",PRO_Office as "PracticeName",Pro_Lname as "ProviderFirstName",Pro_Fname as "ProviderLastName",Pro_sys as "System affiliate Field367",--val_desc,pro_pcs as PCS#,pro_spec1 as "Specialty1",pro_spec2 as "Specialty2",pro_spec3 as "Specialty3",pro_spec4 as "Specialty4",pro_degree as "ProviderDegree",pro_addr1 as "ProviderAddress1",pro_addr1 as "BillingAddress1",pro_addr2 as "ProviderAddress2",pro_addr2 as "BillingAddress2",pro_city as "ProviderCity",pro_city as "Billing Address2",pro_state as "ProviderState",pro_state as BillingState,pro_zip as "ProviderZip",pro_zip as "BillingZip",pro_phone as "ProviderPhone",pro_fax as "ProviderFax",PRO_BTAGpro2.PRO_BTAGFROM dbo.pro |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-01-09 : 01:32:37
|
| and dont use single or double quotes on alias namesMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|