Click here to Skip to main content
16,016,192 members
Home / Discussions / Database
   

Database

 
AnswerRe: how to make remote sql query analyzer in asp.net Pin
Mycroft Holmes6-Dec-13 13:15
professionalMycroft Holmes6-Dec-13 13:15 
Questionms access 2007 update query? Pin
murali_utr5-Dec-13 22:08
murali_utr5-Dec-13 22:08 
AnswerRe: ms access 2007 update query? Pin
Eddy Vluggen5-Dec-13 22:26
professionalEddy Vluggen5-Dec-13 22:26 
AnswerRe: ms access 2007 update query? Pin
Dineshshp5-Dec-13 22:37
professionalDineshshp5-Dec-13 22:37 
GeneralRe: ms access 2007 update query? Pin
Jörgen Andersson5-Dec-13 22:54
professionalJörgen Andersson5-Dec-13 22:54 
QuestionINTERSECT vs SELF-JOINS Pin
Joe Woodbury5-Dec-13 12:16
professionalJoe Woodbury5-Dec-13 12:16 
AnswerRe: INTERSECT vs SELF-JOINS Pin
Mycroft Holmes5-Dec-13 13:15
professionalMycroft Holmes5-Dec-13 13:15 
AnswerRe: INTERSECT vs SELF-JOINS Pin
Jörgen Andersson5-Dec-13 21:31
professionalJörgen Andersson5-Dec-13 21:31 
Use joins whenever it's possible. The DB will then be able to use indexes for the joining.
Intersect is meant to be used when you have two resultsets with the same columns but different origins and no common indexing.

Instead of a self join you can try this query:
SQL
SELECT  W.name
FROM    Words w JOIN Letters l ON w.ID = l.id
WHERE   l.letter IN ('A','C')
GROUP BY    W.name
HAVING  Count(w.name) = 2
A group by is generally faster than a distinct and it will never need more than one index seek, your self join might need two depending on what the optimizer comes up with. But it's a bit quirky as you need to have the letter count available.
But you should consider it if you have large resultsets because it can be pipelined and therefore need much less memory.
Politicians are always realistically manoeuvering for the next election. They are obsolete as fundamental problem-solvers.
Buckminster Fuller

AnswerRe: INTERSECT vs SELF-JOINS Pin
Richard Deeming6-Dec-13 1:43
mveRichard Deeming6-Dec-13 1:43 
QuestionFUNCTION mydatabase.sp_add_new_job_order does not exists Pin
Jassim Rahma5-Dec-13 0:15
Jassim Rahma5-Dec-13 0:15 
QuestionTrouble with date selection Pin
jkirkerx4-Dec-13 11:37
professionaljkirkerx4-Dec-13 11:37 
QuestionThe conversion of a varchar data type to a datetime data type resulted in an out-of-range value. The statement has been terminated. Pin
Member 104375991-Dec-13 8:07
Member 104375991-Dec-13 8:07 
AnswerRe: The conversion of a varchar data type to a datetime data type resulted in an out-of-range value. The statement has been terminated. Pin
RedDk1-Dec-13 9:35
RedDk1-Dec-13 9:35 
AnswerRe: The conversion of a varchar data type to a datetime data type resulted in an out-of-range value. The statement has been terminated. PinPopular
Mycroft Holmes1-Dec-13 11:59
professionalMycroft Holmes1-Dec-13 11:59 
Questionprotect my database - your advsie plz Pin
Jassim Rahma1-Dec-13 5:19
Jassim Rahma1-Dec-13 5:19 
AnswerRe: protect my database - your advsie plz Pin
GuyThiebaut1-Dec-13 23:20
professionalGuyThiebaut1-Dec-13 23:20 
GeneralRe: protect my database - your advsie plz Pin
Jassim Rahma2-Dec-13 22:30
Jassim Rahma2-Dec-13 22:30 
GeneralRe: protect my database - your advsie plz Pin
Richard Deeming3-Dec-13 1:36
mveRichard Deeming3-Dec-13 1:36 
AnswerRe: protect my database - your advsie plz Pin
Eddy Vluggen3-Dec-13 7:12
professionalEddy Vluggen3-Dec-13 7:12 
AnswerWindows Form BindingSource not saving changes in database Pin
Dean Henderson29-Nov-13 10:09
Dean Henderson29-Nov-13 10:09 
QuestionReference Pin
tsunamigang29-Nov-13 1:59
tsunamigang29-Nov-13 1:59 
AnswerRe: Reference Pin
Corporal Agarn29-Nov-13 2:06
professionalCorporal Agarn29-Nov-13 2:06 
GeneralRe: Reference Pin
tsunamigang29-Nov-13 2:12
tsunamigang29-Nov-13 2:12 
GeneralRe: Reference Pin
Chris Quinn29-Nov-13 2:41
Chris Quinn29-Nov-13 2:41 
AnswerRe: Reference Pin
Richard MacCutchan29-Nov-13 6:15
mveRichard MacCutchan29-Nov-13 6:15 

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.