Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by Thorsten3

  1. Thorsten3

    select reucursivly

    with your select I got an error message: db2 => WITH TEMPTABLE (parent,name) AS (SELECT parent,name FROM test WHERE id = 4 UNION ALL SELECT X.parent,X.name FROM test X, TEMPTABLE Y WHERE Y.name = X.parent) SELECT name FROM TEMPTABLE SQL0401N The data types of the operands for the operation...
  2. Thorsten3

    select reucursivly

    T. Blom, I checked your select, but it didn't seem to work: db2 => select * from test ID NAME PARENT ----------- ---------- ----------- 1 aaa - 2 bbb 1 3 ccc 1 4 ddd 3 4...
  3. Thorsten3

    select reucursivly

    I'd like to represent a hierarchy in a table like id name parent1 aaa null 2 bbb 1 3 ccc 1 4 ddd 3 is it possible to select reucursivly? For example for id 4 I would like a result like this: aaa-ccc-ddd For id 3 like this: aaa-ccc I read in the ansi SQL forum oracle can...
  4. Thorsten3

    recursive select

    thanks rudy! I'm using db2 at the moment. I suppose db2 can not do it!? I will use oracle however in the near future, how would the select command actually look like for the example above? thorsten
  5. Thorsten3

    recursive select

    I'd like to represent a hierarchy in a table like id name parent1 aaa null 2 bbb 1 3 ccc 1 4 ddd 3 is it possible to select reucursivly? For example for id 4 I would like a result like this: aaa-ccc-ddd For id 3 like this: aaa-ccc
  6. Thorsten3

    unique or null

    Thanks for your help, unfortunatly DB2 does not allow multiple nulls in a unique columns, I guess I let my application do the job. db2 => create table test ( id integer not null, name varchar(50), primary key (id), unique (name) ) During SQL processing it returned: SQL0542N...
  7. Thorsten3

    unique or null

    Is it possible to create a table with a unique constrain on a column, but allow null values? I want to make sure that a new value which is inserted into the table is not present already except if it is null.
  8. Thorsten3

    multiple insert

    T. Blom: Thank you, this works. Thorsten
  9. Thorsten3

    multiple insert

    I would like to insert more rows into the table t_str_dag using the following select command, but I always get this "specifies multiple columns"- Error even though the select command alone gives me exactly what I want to insert.??? db2 => select id, id/100 *100 from t_structures...
  10. Thorsten3

    count distinct

    Thanks crufty and bperry this worked SELECT count(*) FROM ( select distinct clone_id, stage from t_expression) as q
  11. Thorsten3

    count distinct

    Does the following help? select count(*) from t_expression group by clone_id,stage basically Yes, but like this: select distinct clone_id, stage from t_expression ...it gives me a list. As I execute it from a java program, I don't want to run through the loops of the result set and count the...
  12. Thorsten3

    count distinct

    Sorry it was not clear enough. select count (distinct clone_id) from t_expression ...is not what I'm interested in. I would like to know how many records there are, where the combination of clone_id and stage are distinct. The command above doesn't contain the stage. But if I include the...
  13. Thorsten3

    count distinct

    This query gives me a list of 1085 records: select distinct clone_id, stage from t_expression but I don't need the list, I only need to count them How can I do this? This command works, but it is not what I want: select count (distinct clone_id) from t_expression These commands do not work...
  14. Thorsten3

    list indexes

    Thanks, it worked! describe select * from sysibm.sysindexes select NAME,CREATOR, TBNAME, COLNAMES from sysibm.sysindexes sorry I didn't know about the DB2 forum
  15. Thorsten3

    list indexes

    Thanks a lot! Unfortunatly I use DB2 and both comands didn't work. :(

Part and Inventory Search

Back
Top