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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: habesha
  • Order by date
  1. habesha

    distinct key word problem

    I have three tables Table1 col1, col2 Table2 col1, col2 table3 col1, col2, col3 col2 of table2 is a foreign key refering tabl1(col1) col2 of table3 is a foreign key refering table2(col1) I want to get for each col1 in table1, how many distinct values of col3 are there in table3 I tryed...
  2. habesha

    join statement question

    Thank you george's suggestions works fine Thank you I appreciate that
  3. habesha

    join statement question

    you mean select tbl1.* from tbl1 inner join tbl2 on tbl1.col2 = tbl2.col1 inner join tbl3 on tbl1.col2 = tbl3.col1 where ((tbl3.col2 is not null) AND (tbl2.col2 is not null)) this code is not giving me the right recordset col1 col2 1 1 2 1 3 2 4 3 the query...
  4. habesha

    join statement question

    Hi, I have three table say tbl1 col1 col2 1 1 2 1 3 2 4 3 tbl2 col1 col2 1 aa 2 bb tbl3 col1 col2 1 dd 2 ee 3 ff col2 of tbl1 is a foreign key refering to col2 of both tbl2 and tbl3 I want to...
  5. habesha

    question on join statement

    it is returnig more records there ia a duplicate value on sve.sve_stu_id, sso.sso_stu_id, ses.SES_SVE_ID, eae.EAE_SES_ID what should my could look like in ansi-standard join statement
  6. habesha

    question on join statement

    I was trying to convert this query to ansi standard join statemet, but it is not giving the same record set waht did I miss <html> <head> <title>query that should be converted</title> </head> <body> SELECT eae.EAE_SES_ID FROM PHOENIX.EXPEDITED_ADVERSE_EVENTS EAE WHERE...
  7. habesha

    query iptimization question

    I have a query and, no matter how many indexes I have added I can't remove the clustered index scanning what do you suggest below is the show plan text |--Filter(WHERE:(((((((([@p_In_EVT_LAST_CHANGED_USER_ID_Num]=NULL OR...
  8. habesha

    performace problem

    This still goes to index scanning whta should I do to improve it Thanks
  9. habesha

    performace problem

    Thank you for ur swift response Actually the query is like this.There is an incoming parameter @p_In_EAE_NUMBER_Vch SELECT EAE_ID FROM EXPEDITED_ADVERSE_EVENTS WHERE CAST(EAE_NUMBER AS VARCHAR(15)) LIKE ISNULL(@p_In_EAE_NUMBER_Vch, CAST(EAE_NUMBER AS VARCHAR(15)) ) any suggestion
  10. habesha

    performace problem

    I have this query The table PHOENIX.EXPEDITED_ADVERSE_EVENTS has clustsed index defined on EAE_ID and nonclustsred index defined on EAE_NUMBER SELECT EAE_ID FROM PHOENIX.EXPEDITED_ADVERSE_EVENTS WHERE CAST(EAE_NUMBER AS VARCHAR(15)) LIKE ISNULL(NULL, CAST(EAE_NUMBER AS VARCHAR(15)) ) when I...
  11. habesha

    index optimization question

    to make the que easy I have a table over 14 columns a clustsred index is defined on the PK. I am wrting a query to select 10 of the xolumns from the table, which leads to a clustsred index scan( that makes my query very slow) I want to optimize the query by adding some indexes. do I have to add...
  12. habesha

    index optimization question

    what is a substitute for covering index in sql server 2000 There are many columns which are causing clustsred index scan that degrades my query performance here is part of the showplan in my query |--Clustered Index Scan(OBJECT:([DaidsesDev4].[Phoenix].[EAE_DIAGNOSTICS].[EDI_ID_PK])...
  13. habesha

    indexing question

    ---code SELECT 'Study Agent' AS StudyProductType, esp.ESP_PRODUCT_NAME AS StudyIntervention, esp.ESP_RELATIONSHIP_TYPE AS RelationshipToPrimaryAE, esp.ESP_EXPECTED_TYPE AS StudyProductExpectedness FROM phoenix.EAE_STUDY_PRODUCTS esp INNER JOIN phoenix.EAE_STUDY_AGENTS esa ON esa.ESA_ESP_ID...
  14. habesha

    indexing question

    yes but it still scans the clustered index
  15. habesha

    indexing question

    I have created a nonclustsred index on a column of a table that is refered in on stataement of a inner join statement; but it is still going clustsred index scan, what is the reason behind this and how can I solve this Thanks
  16. habesha

    How can I improve this query

    I have a table say tbl col1 col2 1 A 2 B 3 C Null F 5 G Null H Here is what I want a parameter is passed to my stored proc @col1 int = Null I want to select a value from tbl1 according to @col1 if @col1 is null I will select all the records of tbl...
  17. habesha

    question on NULL

    I have a local variable say @var I want to select some data from a table XY based on the values of these local variable. The values for the local variable can be NULL or have data Here is what I want, I want to write a single query to select data from the table only if the variable is not null...
  18. habesha

    sql question

    Thank you every body
  19. habesha

    sql question

    Given this table col1 col2 1 yes 1 no 2 yes 2 yes 3 no 3 no 4 yes 4 no I want to query out that for each value in col1 if its corresponding value in col2 is yes, yes - it will be yes, no, yes - it will be yes, no, no it will...
  20. habesha

    sql que

    Thank you very much I appreciate that now I want to write a query that for each record in the parent tables I want to get the corresponding record in the child table in a single column eg id 1 has in parent table has three corresponding record in child table my output should look like id...

Part and Inventory Search

Back
Top