Click here to Skip to main content
15,900,616 members
Home / Discussions / Database
   

Database

 
GeneralRe: Regarding case control statement in mysql Pin
aghori9-Jun-14 3:34
aghori9-Jun-14 3:34 
AnswerRe: Regarding case control statement in mysql Pin
Jörgen Andersson9-Jun-14 3:25
professionalJörgen Andersson9-Jun-14 3:25 
GeneralRe: Regarding case control statement in mysql Pin
aghori9-Jun-14 3:37
aghori9-Jun-14 3:37 
Questiondatatype mapping Pin
Gilbert Consellado8-Jun-14 22:14
professionalGilbert Consellado8-Jun-14 22:14 
AnswerRe: datatype mapping Pin
Richard MacCutchan8-Jun-14 23:24
mveRichard MacCutchan8-Jun-14 23:24 
GeneralRe: datatype mapping Pin
Gilbert Consellado8-Jun-14 23:47
professionalGilbert Consellado8-Jun-14 23:47 
GeneralRe: datatype mapping Pin
Richard MacCutchan8-Jun-14 23:56
mveRichard MacCutchan8-Jun-14 23:56 
GeneralRe: datatype mapping Pin
Gilbert Consellado9-Jun-14 0:04
professionalGilbert Consellado9-Jun-14 0:04 
QuestionSQL Server and ADO.net IsolationLevel Pin
PIEBALDconsult6-Jun-14 16:10
mvePIEBALDconsult6-Jun-14 16:10 
AnswerRe: SQL Server and ADO.net IsolationLevel Pin
Eddy Vluggen6-Jun-14 23:05
professionalEddy Vluggen6-Jun-14 23:05 
GeneralRe: SQL Server and ADO.net IsolationLevel Pin
PIEBALDconsult7-Jun-14 4:39
mvePIEBALDconsult7-Jun-14 4:39 
QuestionHow to Sort this, Get Next Record ID when Many users inserting and different Districts Pin
Robymon5-Jun-14 23:03
Robymon5-Jun-14 23:03 
SuggestionRe: How to Sort this, Get Next Record ID when Many users inserting and different Districts Pin
GuyThiebaut6-Jun-14 0:55
professionalGuyThiebaut6-Jun-14 0:55 
GeneralRe: How to Sort this, Get Next Record ID when Many users inserting and different Districts Pin
Robymon6-Jun-14 2:19
Robymon6-Jun-14 2:19 
GeneralRe: How to Sort this, Get Next Record ID when Many users inserting and different Districts Pin
GuyThiebaut6-Jun-14 2:24
professionalGuyThiebaut6-Jun-14 2:24 
GeneralRe: How to Sort this, Get Next Record ID when Many users inserting and different Districts Pin
ZurdoDev6-Jun-14 2:49
professionalZurdoDev6-Jun-14 2:49 
AnswerRe: How to Sort this, Get Next Record ID when Many users inserting and different Districts Pin
Eddy Vluggen6-Jun-14 2:36
professionalEddy Vluggen6-Jun-14 2:36 
AnswerRe: How to Sort this, Get Next Record ID when Many users inserting and different Districts Pin
PIEBALDconsult6-Jun-14 14:38
mvePIEBALDconsult6-Jun-14 14:38 
QuestionSQLite query Pin
David Crow5-Jun-14 10:38
David Crow5-Jun-14 10:38 
I have the following three tables:

TABLE_A        TABLE_B               TABLE_C
-------        ---------             -------
id (primary)   tablea_id (foreign)   tablea_id (foreign)
name           boards                text
date
phone


I have the following query to select all rows from TABLE_A and also count how many related rows are in each of the other two tables:

SELECT *, (SELECT COUNT(TABLE_B.tablea_id) FROM TABLE_B WHERE TABLE_B.tablea_id == TABLE_A.id) AS Cnt1, (SELECT COUNT(TABLE_C.tablea_id) FROM TABLE_C WHERE TABLE_C.tablea_id == TABLE_A.id) AS Cnt2 FROM TABLE_A


This works fine, but I was curious if: 1) SQL was doing three separate queries behind the scene, and 2) a more efficient way exists.

Thank you.
- DC

"One man's wage rise is another man's price increase." - Harold Wilson

"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles


AnswerRe: SQLite query Pin
Mycroft Holmes5-Jun-14 12:47
professionalMycroft Holmes5-Jun-14 12:47 
GeneralRe: SQLite query Pin
David Crow5-Jun-14 17:38
David Crow5-Jun-14 17:38 
QuestionQuestion on Canidate keys and functional dependecies Pin
Member 108651294-Jun-14 16:35
Member 108651294-Jun-14 16:35 
AnswerRe: Question on Canidate keys and functional dependecies Pin
Eddy Vluggen5-Jun-14 8:05
professionalEddy Vluggen5-Jun-14 8:05 
AnswerRe: Question on Canidate keys and functional dependecies Pin
Eddy Vluggen6-Jun-14 23:39
professionalEddy Vluggen6-Jun-14 23:39 
QuestionIssue deploying SSIS Package in production web server Pin
Shuaib Kaniyar4-Jun-14 0:46
Shuaib Kaniyar4-Jun-14 0:46 

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.