I have a table (tblCustomer) with three fields (customer_id, s_id, s_string) I want to fill in this table with two fixed values and customer_id from another table.
Every customer that starts at P in tblMainCustomer.customer_nr should be entered in table tblCustomer.
Customer_id taken from tblMainCustomer and s_id, s_string these fixed values that are equal for each customer.
The result in tblCustomer should be like this:
I have a working solution for SQL server, but I needs a working solution for Sybase now.
asked 01 May '14, 11:58
Somethink like this should work:
create table #temp ( s_id int, s_string nvarchar(35) );
insert into #temp values (100, 'Gold'); insert into #temp values (101, 'Steel'); insert into #temp values (102, 'Super Copper');
insert into tblcustomer select customer_id, s_Id, s_string from tblMainCustomer, #temp where customer_nr like 'P%';
answered 01 May '14, 12:42