K
krisworld
dear all
this might be a simple one to many, but I am struck in this Query.
Problem:
I want to insert into a table some records which i need to fetch from
select statement.
Now if the select statement does has a record it its fine.
but if it does not has a record a default valule should be inserted.
some thing like
insert into mytable (field1) select field1, (select count(*) from
table1 where field2="something") from table1 where field1="target"
any idea to help
thanks
krisworld
this might be a simple one to many, but I am struck in this Query.
Problem:
I want to insert into a table some records which i need to fetch from
select statement.
Now if the select statement does has a record it its fine.
but if it does not has a record a default valule should be inserted.
some thing like
insert into mytable (field1) select field1, (select count(*) from
table1 where field2="something") from table1 where field1="target"
any idea to help
thanks
krisworld