Click here to Skip to main content
15,887,485 members
Home / Discussions / Database
   

Database

 
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 
GeneralRe: SQL Query Pin
Blue_Boy1-Apr-08 9:17
Blue_Boy1-Apr-08 9:17 
GeneralRe: SQL Query Pin
Ali Rashid1-Apr-08 22:05
Ali Rashid1-Apr-08 22:05 
GeneralRe: SQL Query Pin
Blue_Boy2-Apr-08 7:43
Blue_Boy2-Apr-08 7:43 
GeneralRe: SQL Query [modified] Pin
Syed Mehroz Alam2-Apr-08 9:30
Syed Mehroz Alam2-Apr-08 9:30 
GeneralRe: SQL Query Pin
Blue_Boy3-Apr-08 12:14
Blue_Boy3-Apr-08 12:14 
AnswerRe: SQL Query Pin
mushfiqcs2-Apr-08 1:10
mushfiqcs2-Apr-08 1:10 
GeneralRe: SQL Query Pin
mushfiqcs2-Apr-08 1:10
mushfiqcs2-Apr-08 1:10 
QuestionRAM usage Pin
Dobromir Dimitrov31-Mar-08 21:55
Dobromir Dimitrov31-Mar-08 21:55 
GeneralRe: RAM usage Pin
GuyThiebaut31-Mar-08 23:56
professionalGuyThiebaut31-Mar-08 23:56 
GeneralRe: RAM usage Pin
Ali Rashid1-Apr-08 23:28
Ali Rashid1-Apr-08 23:28 
GeneralRe: RAM usage Pin
SimulationofSai2-Apr-08 1:23
SimulationofSai2-Apr-08 1:23 
GeneralMS Acess SQL Query using VS Query Builder and Variable Field Names Pin
Christian Yeates31-Mar-08 21:33
Christian Yeates31-Mar-08 21:33 
Questionhow to save only time in database field Pin
findtango31-Mar-08 19:10
findtango31-Mar-08 19:10 
GeneralRe: how to save only time in database field Pin
pmarfleet31-Mar-08 19:45
pmarfleet31-Mar-08 19:45 

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.