Click here to Skip to main content
15,911,035 members
Home / Discussions / Database
   

Database

 
QuestionAccess denied - urgent Pin
dansoft28-Jul-06 6:58
dansoft28-Jul-06 6:58 
AnswerRe: Access denied - urgent Pin
VK-Cadec28-Jul-06 7:35
VK-Cadec28-Jul-06 7:35 
AnswerRe: Access denied - urgent [modified] Pin
S Douglas29-Jul-06 20:04
professionalS Douglas29-Jul-06 20:04 
QuestionReferential Integrity Question [modified] Pin
xfitr228-Jul-06 6:27
xfitr228-Jul-06 6:27 
AnswerRe: Referential Integrity Question Pin
ToddHileHoffer28-Jul-06 6:57
ToddHileHoffer28-Jul-06 6:57 
QuestionSQL Server Connection Pin
smarttom9928-Jul-06 5:31
smarttom9928-Jul-06 5:31 
AnswerRe: SQL Server Connection Pin
ToddHileHoffer28-Jul-06 7:00
ToddHileHoffer28-Jul-06 7:00 
QuestionCombining results of two queries Pin
coolestCoder28-Jul-06 4:19
coolestCoder28-Jul-06 4:19 
Hi All,
I have a problem combining results of two queries. The queries are fired on the same table with the same select list, only the where condition changes. It would be better if i show what i actually want.


This is my table data for example.

Field1 Field2
AB 1
SD 2
SDFG 3
AS 4
QWE 5
BBG 6


I want an output as

Field1 Field2
AS 4
QWE 5
BBG 6
AB 1
SD 2


That means , if i give the value for Field2 = 3 in the query then the result will not contain record with Field2 = 3 and the result should display the record with Field2 > 3
first and the with Field2 < 3 both sorted in ascending order.

I am using the union operator for combining results, but the results are not as desired. Also i feel that the union clause is not efficient since it takes about 4-6 secs to fetch the records.

Is there any efficient solution for my problem. Please reply soon as i have already spent considerable time on this query and i am running short of time now.

Any help will be appreciable.



Thanks in Advance.



"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder

Anant Y. Kulkarni

AnswerRe: Combining results of two queries Pin
ToddHileHoffer28-Jul-06 5:35
ToddHileHoffer28-Jul-06 5:35 
QuestionDatasets + Update Issue [modified] Pin
Tristan Rhodes28-Jul-06 4:07
Tristan Rhodes28-Jul-06 4:07 
AnswerConfirmed Pin
Tristan Rhodes31-Jul-06 0:37
Tristan Rhodes31-Jul-06 0:37 
Questionproblem with update Pin
Jeeva Mary Varghese28-Jul-06 2:13
Jeeva Mary Varghese28-Jul-06 2:13 
AnswerRe: problem with update Pin
Eric Dahlvang28-Jul-06 4:24
Eric Dahlvang28-Jul-06 4:24 
GeneralRe: problem with update [modified] Pin
Jeeva Mary Varghese28-Jul-06 20:02
Jeeva Mary Varghese28-Jul-06 20:02 
GeneralRe: problem with update Pin
Eric Dahlvang31-Jul-06 3:32
Eric Dahlvang31-Jul-06 3:32 
QuestionFirebirdSql.Data.Firebird.FbException ? Pin
nick_net128-Jul-06 1:10
nick_net128-Jul-06 1:10 
QuestionRegarding retrieve the data from two different tables Pin
ChennaiBabu28-Jul-06 1:07
ChennaiBabu28-Jul-06 1:07 
AnswerRe: Regarding retrieve the data from two different tables Pin
Mairaaj Khan28-Jul-06 2:19
professionalMairaaj Khan28-Jul-06 2:19 
AnswerRe: Regarding retrieve the data from two different tables Pin
enjoycrack29-Jul-06 6:22
enjoycrack29-Jul-06 6:22 
Question[Message Deleted] Pin
very_short_life27-Jul-06 23:17
very_short_life27-Jul-06 23:17 
AnswerRe: pleeeeeeeeeeeeeeeeeeeese help Pin
jebberwocky27-Jul-06 23:41
jebberwocky27-Jul-06 23:41 
AnswerRe: pleeeeeeeeeeeeeeeeeeeese help Pin
Hy Chanhan28-Jul-06 1:20
professionalHy Chanhan28-Jul-06 1:20 
AnswerRe: pleeeeeeeeeeeeeeeeeeeese help Pin
Ravi kumar G29-Jul-06 2:52
Ravi kumar G29-Jul-06 2:52 
AnswerRe: pleeeeeeeeeeeeeeeeeeeese help Pin
S Douglas29-Jul-06 20:36
professionalS Douglas29-Jul-06 20:36 
AnswerRe: pleeeeeeeeeeeeeeeeeeeese help Pin
Ennis Ray Lynch, Jr.31-Jul-06 8:40
Ennis Ray Lynch, Jr.31-Jul-06 8:40 

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.