Hi Folks,
I am a total novice. I am trying to write a query with two tables, a client table that has a one to many relationship to an encounter table. I want the query to return distinct client records. The client table has an extensive amount of fields in it and I would like to avoid having to enter each field under the Select statement. I tried the following but it does not seem to work:
SELECT Distinct "ai_clien".*
INTO dbo.ai_clien_prev
FROM "urs"."dbo"."ai_clien" "ai_clien"
INNER JOIN "urs"."dbo"."ai_enc_prev" "ai_enc_prev"
ON "ai_clien"."tc_id"="ai_enc_prev"."tc_id")
Any thoughts on an easy way to do this would be greatly appreciated.
Thanks,
D
I am a total novice. I am trying to write a query with two tables, a client table that has a one to many relationship to an encounter table. I want the query to return distinct client records. The client table has an extensive amount of fields in it and I would like to avoid having to enter each field under the Select statement. I tried the following but it does not seem to work:
SELECT Distinct "ai_clien".*
INTO dbo.ai_clien_prev
FROM "urs"."dbo"."ai_clien" "ai_clien"
INNER JOIN "urs"."dbo"."ai_enc_prev" "ai_enc_prev"
ON "ai_clien"."tc_id"="ai_enc_prev"."tc_id")
Any thoughts on an easy way to do this would be greatly appreciated.
Thanks,
D