Hi All, I have a query which is as follows Select COL1,COL2,COL3 (SELECT MAX(COST) FROM COSTTABLE WHERE COSTTABLE.NO = SALESTABLE.NO) SALESCOST FROM Materials INNER JOIN PROJECTS ON MATERIALS.NO = PROJECTS.NO My problem is I am getting 2 similar rows for Maxium cost,please can anyone let me know how can I select single row.I have COSTID WHICH IS IDENTITY COLUMN ,I am not sure how to select the max costid ......Please anyone .......can let me know
Check this out:http://www.sql-server-performance.com/faq/sqlviewfaq.aspx?topicid=13&faqid=121 Or do you really always want the same cost displayed for each row? -- Frank Kalis Microsoft SQL Server MVP Contributing Editor, Writer & Forum Moderatorhttp://www.sql-server-performance.com Webmaster:http://www.insidesql.de