Click here to Skip to main content
15,891,828 members
Home / Discussions / Database
   

Database

 
GeneralRe: data tables for a job site Pin
Pete O'Hanlon22-Mar-08 9:31
mvePete O'Hanlon22-Mar-08 9:31 
GeneralRe: data tables for a job site Pin
KrisnNala25-Mar-08 9:09
KrisnNala25-Mar-08 9:09 
QuestionOCP Pin
KambojR19-Mar-08 21:56
KambojR19-Mar-08 21:56 
GeneralRe: OCP Pin
Ashfield20-Mar-08 3:20
Ashfield20-Mar-08 3:20 
Questionhow do I use sql triggers to replicate update changes across two different databases Pin
GDMFSOB19-Mar-08 20:56
GDMFSOB19-Mar-08 20:56 
GeneralRe: how do I use sql triggers to replicate update changes across two different databases Pin
andyharman20-Mar-08 0:26
professionalandyharman20-Mar-08 0:26 
AnswerRe: how do I use sql triggers to replicate update changes across two different databases Pin
GDMFSOB20-Mar-08 1:58
GDMFSOB20-Mar-08 1:58 
Generallooping in SQL Server2005 Pin
salon19-Mar-08 20:32
salon19-Mar-08 20:32 
I have a table having columns like values, like this

col1 col2 col3
1000 10 2
1000 20 3
1000 30 4
2000 10 5
2000 20 6
2000 30 7
3000 10 8
3000 20 9
3000 30 10

I want to fetch records like if i enter col2 as 20 and col1 as 1500 then
with
"SELECT col3 FROM table1 WHERE col2 = @col2"

I will get 3 rows having respective records of value 20 for col2(col2 values are fixed)
but col1 values are variable i.e. can fall into different ranges like 1400,1500,2300 etc.
but col2 values are fixed

I want to return only one row for eg. col2 as 20 and col1 as 1500

then
1000 20 3
this row should get returned

How can i do this?

I don't know how to use cursors...
GeneralRe: looping in SQL Server2005 Pin
N a v a n e e t h19-Mar-08 20:44
N a v a n e e t h19-Mar-08 20:44 
GeneralRe: looping in SQL Server2005 Pin
salon19-Mar-08 21:00
salon19-Mar-08 21:00 
GeneralRe: looping in SQL Server2005 Pin
Tobias Schoenig20-Mar-08 0:26
Tobias Schoenig20-Mar-08 0:26 
Questionhow to change the date format Pin
mon***z19-Mar-08 19:08
mon***z19-Mar-08 19:08 
AnswerRe: how to change the date format Pin
N a v a n e e t h19-Mar-08 20:46
N a v a n e e t h19-Mar-08 20:46 
GeneralRe: how to change the date format Pin
Vimalsoft(Pty) Ltd19-Mar-08 21:27
professionalVimalsoft(Pty) Ltd19-Mar-08 21:27 
AnswerRe: how to change the date format Pin
Ashfield19-Mar-08 22:57
Ashfield19-Mar-08 22:57 
Generalmultiplying columns Pin
neoghy19-Mar-08 18:46
neoghy19-Mar-08 18:46 
GeneralRe: multiplying columns Pin
N a v a n e e t h19-Mar-08 20:53
N a v a n e e t h19-Mar-08 20:53 
GeneralGeneric data fetch with IDataReader Pin
RubensFarias19-Mar-08 16:38
RubensFarias19-Mar-08 16:38 
GeneralRe: Generic data fetch with IDataReader Pin
Syed Mehroz Alam20-Mar-08 20:17
Syed Mehroz Alam20-Mar-08 20:17 
GeneralRe: Generic data fetch with IDataReader Pin
RubensFarias23-Mar-08 12:54
RubensFarias23-Mar-08 12:54 
GeneralAdd new columns in the middle of a table Pin
brhnz19-Mar-08 15:22
brhnz19-Mar-08 15:22 
GeneralSelect statement Using the like keyword Pin
Mr Oizo19-Mar-08 4:33
Mr Oizo19-Mar-08 4:33 
GeneralRe: Select statement Using the like keyword Pin
A Wong19-Mar-08 5:27
A Wong19-Mar-08 5:27 
QuestionHow to combine the following Pin
tonyong19-Mar-08 2:37
tonyong19-Mar-08 2:37 
GeneralA domain error occurred in SQL Pin
Eunice (VB junior)18-Mar-08 23:16
Eunice (VB junior)18-Mar-08 23:16 

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.