Link to home
Start Free TrialLog in
Avatar of parpaa
parpaa

asked on

select query

Hi all

I have very simple requirement... I have a table [TM_C_details] with accountno,custname,city,country,zone.
now i have to create new column 'Unique A/c' into another table [TM_NEW_TABLE] if the acountno is unique then Unique a/C should be 1 else 0.

Hope am clear... any suggestions are highly appreciated.
Avatar of Alpesh Patel
Alpesh Patel
Flag of India image

To Insert in another table flag for unniqueness

Select 1 from TM_C_details where PrimaryKey <> current row Primary Key
If return 1 then put 1 in [TM_NEW_TABLE]
ASKER CERTIFIED SOLUTION
Avatar of batchakamal
batchakamal
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of parpaa
parpaa

ASKER

thanks @Patel

Unfortunately NO PRIMARY KEYS HAVE BEEN DEFINED FOR THE TABLES..
Avatar of parpaa

ASKER

@Kamal thanks so much..
It worked