Click here to Skip to main content
15,890,399 members
Home / Discussions / Database
   

Database

 
QuestionCreate multiple tables with a single SQL query Pin
Richard Fernandes, Dubai, UAE14-Jan-14 22:35
Richard Fernandes, Dubai, UAE14-Jan-14 22:35 
AnswerRe: Create multiple tables with a single SQL query Pin
Chris Quinn14-Jan-14 23:56
Chris Quinn14-Jan-14 23:56 
AnswerRe: Create multiple tables with a single SQL query Pin
Eddy Vluggen15-Jan-14 0:28
professionalEddy Vluggen15-Jan-14 0:28 
GeneralRe: Create multiple tables with a single SQL query Pin
Shameel16-Jan-14 3:38
professionalShameel16-Jan-14 3:38 
GeneralRe: Create multiple tables with a single SQL query Pin
Eddy Vluggen16-Jan-14 11:16
professionalEddy Vluggen16-Jan-14 11:16 
SuggestionRe: Create multiple tables with a single SQL query Pin
Richard Deeming15-Jan-14 1:04
mveRichard Deeming15-Jan-14 1:04 
AnswerRe: Create multiple tables with a single SQL query Pin
King Fisher30-Jan-14 2:19
professionalKing Fisher30-Jan-14 2:19 
QuestionProcessing records in select statement in Oracle DB Pin
mrkeivan14-Jan-14 19:39
mrkeivan14-Jan-14 19:39 
Hi guys I have a table with list of records or cards passing a place

ID: int
CarPlate: int
PassDate: date
PassType: byte > 1 enter, 2 exit

I want to select the total amount of time each car has been in that place by date
now this is my strategy but I cant implement it Frown | :(
Imaging in a particular date a cards enters and exits are as followed:
1- enter >
2- enter >
3- < exit
4- enter >
5- < exit

This particular car has entered 3 times and exited two times, I only want the enter and exit that are back to back so I need to select all the enters for all card in a particular date and then for every enter check whether there is a exit before the next enter or not and continue this to the end for each plate and then the next plate.

I have problem implementing this process of going through plates
and at the end for my end result should be something like this

CarPlate | Date | EnterExit | Duration

This EnterExit is a string of collections of enters and exits
enter at ..... exit at .....
enter at ..... exit at .....
enter at ..... exit at .....
enter at ..... exit at .....
.
.
.


Please help me out Smile | :)

modified 15-Jan-14 1:45am.

AnswerRe: Processing records in select statement in Oracle DB Pin
Jörgen Andersson15-Jan-14 0:12
professionalJörgen Andersson15-Jan-14 0:12 
GeneralRe: Processing records in select statement in Oracle DB Pin
mrkeivan15-Jan-14 0:43
mrkeivan15-Jan-14 0:43 
GeneralRe: Processing records in select statement in Oracle DB Pin
Jörgen Andersson15-Jan-14 21:25
professionalJörgen Andersson15-Jan-14 21:25 
QuestionSQL - How to Create a New column based on values from existing column Pin
CodeWeaker14-Jan-14 2:09
CodeWeaker14-Jan-14 2:09 
AnswerRe: SQL - How to Create a New column based on values from existing column Pin
Mycroft Holmes14-Jan-14 2:30
professionalMycroft Holmes14-Jan-14 2:30 
AnswerRe: SQL - How to Create a New column based on values from existing column Pin
CodeWeaker14-Jan-14 4:48
CodeWeaker14-Jan-14 4:48 
Questionstored procedures in mysql Pin
Member 1026351910-Jan-14 1:17
Member 1026351910-Jan-14 1:17 
AnswerRe: stored procedures in mysql Pin
GuyThiebaut10-Jan-14 1:35
professionalGuyThiebaut10-Jan-14 1:35 
GeneralRe: stored procedures in mysql Pin
Member 1026351910-Jan-14 1:42
Member 1026351910-Jan-14 1:42 
QuestionRe: stored procedures in mysql Pin
GuyThiebaut10-Jan-14 1:51
professionalGuyThiebaut10-Jan-14 1:51 
AnswerRe: stored procedures in mysql Pin
Wayne Gaylard10-Jan-14 1:50
professionalWayne Gaylard10-Jan-14 1:50 
GeneralRe: stored procedures in mysql Pin
Member 1026351910-Jan-14 18:24
Member 1026351910-Jan-14 18:24 
GeneralRe: stored procedures in mysql Pin
Member 1026351910-Jan-14 18:26
Member 1026351910-Jan-14 18:26 
GeneralRe: stored procedures in mysql Pin
Member 1026351910-Jan-14 19:16
Member 1026351910-Jan-14 19:16 
GeneralRe: stored procedures in mysql Pin
GuyThiebaut10-Jan-14 23:26
professionalGuyThiebaut10-Jan-14 23:26 
QuestionLog shipping of SQL2012 databases failing Pin
Chris Quinn8-Jan-14 22:33
Chris Quinn8-Jan-14 22:33 
AnswerRe: Log shipping of SQL2012 databases failing Pin
jschell12-Jan-14 9:17
jschell12-Jan-14 9:17 

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.