Click here to Skip to main content
15,897,226 members
Home / Discussions / Database
   

Database

 
GeneralRe: Work with query results inside a stored procedure Pin
Yevgeny Efter1-Apr-08 23:02
Yevgeny Efter1-Apr-08 23:02 
GeneralRe: Work with query results inside a stored procedure Pin
Yevgeny Efter1-Apr-08 23:59
Yevgeny Efter1-Apr-08 23:59 
GeneralGenerating REPORTS DYNAMICALLY in Sql Server Reporting Services (SSRS 2005) Pin
Aswanth1-Apr-08 21:40
Aswanth1-Apr-08 21:40 
Generalconverting char to datatime Pin
uglyeyes1-Apr-08 21:34
uglyeyes1-Apr-08 21:34 
GeneralRe: converting char to datatime Pin
Ali Rashid1-Apr-08 22:24
Ali Rashid1-Apr-08 22:24 
QuestionHow to get max value from each row of the table Pin
Sallu17491-Apr-08 21:09
Sallu17491-Apr-08 21:09 
AnswerRe: How to get max value from each row of the table Pin
Rob Philpott1-Apr-08 22:58
Rob Philpott1-Apr-08 22:58 
GeneralSQL Script generator Pin
AlexeiXX31-Apr-08 20:24
AlexeiXX31-Apr-08 20:24 
GeneralRe: SQL Script generator Pin
Mark J. Miller2-Apr-08 9:37
Mark J. Miller2-Apr-08 9:37 
GeneralReporting Services Pin
Payal_e_m1-Apr-08 17:36
Payal_e_m1-Apr-08 17:36 
GeneralConnection LifeTime Pin
hashok1-Apr-08 8:24
hashok1-Apr-08 8:24 
GeneralRe: Connection LifeTime Pin
Ali Rashid1-Apr-08 23:05
Ali Rashid1-Apr-08 23:05 
GeneralsqlBase --> sql server Pin
teddddddddddd1-Apr-08 7:04
teddddddddddd1-Apr-08 7:04 
GeneralRe: sqlBase --> sql server Pin
Mark J. Miller2-Apr-08 9:47
Mark J. Miller2-Apr-08 9:47 
GeneralSend table name to a stored procedure Pin
Yevgeny Efter1-Apr-08 6:51
Yevgeny Efter1-Apr-08 6:51 
GeneralRe: Send table name to a stored procedure Pin
Yevgeny Efter1-Apr-08 8:09
Yevgeny Efter1-Apr-08 8:09 
GeneralSQL or XML Pin
Sutheesh chandran1-Apr-08 1:16
Sutheesh chandran1-Apr-08 1:16 
GeneralRe: SQL or XML Pin
Rob Philpott1-Apr-08 1:42
Rob Philpott1-Apr-08 1:42 
Questionhow can i copy a column data to a same column Pin
koolprasad200331-Mar-08 23:58
professionalkoolprasad200331-Mar-08 23:58 
AnswerRe: how can i copy a column data to a same column Pin
Rob Philpott1-Apr-08 1:43
Rob Philpott1-Apr-08 1:43 
AnswerRe: how can i copy a column data to a same column Pin
Ashfield1-Apr-08 2:07
Ashfield1-Apr-08 2:07 
GeneralSQL Query Pin
Ali Rashid31-Mar-08 23:45
Ali Rashid31-Mar-08 23:45 
Hi Guys!
I am using the following Statements:

Select min(ItemPrice) as MinUniquePrice, max(ItemPrice) as MaxUniquePrice
From ( select ItemPrice, Count(*) as ItemPriceCount
from #Mytable
group by ItemPrice
Having Count(*) = 1) as MyTableWithUniqueItemPrices

which returns me the unique value in the table. The only problem is, how do I also get the itemID without the SQL Server listing all the values in the Table. My Original Question is pasted below for reference.

Thanks once again to all the guys who had helped me earlier.

Ali.
-----------------------------------------------------------------------------------------------

ORIGINAL QUESTION:
=================

I tried to look around but I could not find an answer for this question. I need to run an SQl Query which retuns me the highest Unique Value and the lowest Unique value from the same column. For example. Lets say the column name is itemPrice, and has the following values: 10, 10, 11, 12, 12, 13, 14, 14 respectively. How can I get the 11 and 13 as the result of my query. I have tried DISTINCT, MIN, MAX and HAVING but to no avail. I am using SQL Server 2000.
GeneralRe: SQL Query Pin
Blue_Boy1-Apr-08 3:28
Blue_Boy1-Apr-08 3:28 
GeneralRe: SQL Query Pin
Ali Rashid1-Apr-08 6:01
Ali Rashid1-Apr-08 6:01 
GeneralRe: SQL Query Pin
Ali Rashid1-Apr-08 6:07
Ali Rashid1-Apr-08 6:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.