SQL Select i dunno what exactly mean
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
i have sql table like this
pets playstart endstart
cat 12:10 12:50
dog 13:10 13:50
lion 14:10 14:50
if i select 13:35
result dog
how create sql query for this command?
mysql sql
add a comment |
i have sql table like this
pets playstart endstart
cat 12:10 12:50
dog 13:10 13:50
lion 14:10 14:50
if i select 13:35
result dog
how create sql query for this command?
mysql sql
What data type in date column?
– dwir182
Nov 23 '18 at 7:37
1
Try to make your question title more closely reflect your actual question. "i dunno what exactly mean" isn't very useful for searching on.
– Nick
Nov 23 '18 at 7:38
add a comment |
i have sql table like this
pets playstart endstart
cat 12:10 12:50
dog 13:10 13:50
lion 14:10 14:50
if i select 13:35
result dog
how create sql query for this command?
mysql sql
i have sql table like this
pets playstart endstart
cat 12:10 12:50
dog 13:10 13:50
lion 14:10 14:50
if i select 13:35
result dog
how create sql query for this command?
mysql sql
mysql sql
edited Nov 23 '18 at 7:36
Chowkidar Madhur Bhaiya
19.9k62336
19.9k62336
asked Nov 23 '18 at 7:35
ErlinaErlina
31
31
What data type in date column?
– dwir182
Nov 23 '18 at 7:37
1
Try to make your question title more closely reflect your actual question. "i dunno what exactly mean" isn't very useful for searching on.
– Nick
Nov 23 '18 at 7:38
add a comment |
What data type in date column?
– dwir182
Nov 23 '18 at 7:37
1
Try to make your question title more closely reflect your actual question. "i dunno what exactly mean" isn't very useful for searching on.
– Nick
Nov 23 '18 at 7:38
What data type in date column?
– dwir182
Nov 23 '18 at 7:37
What data type in date column?
– dwir182
Nov 23 '18 at 7:37
1
1
Try to make your question title more closely reflect your actual question. "i dunno what exactly mean" isn't very useful for searching on.
– Nick
Nov 23 '18 at 7:38
Try to make your question title more closely reflect your actual question. "i dunno what exactly mean" isn't very useful for searching on.
– Nick
Nov 23 '18 at 7:38
add a comment |
2 Answers
2
active
oldest
votes
In answer to the question. A select statement is a statement that aims at retrieving some data. SQL was invented to be a human readable way of interacting with databases. As such you can almost phrase your query as a question.
In this case your question would be "What pet would be played with at 13:35?".
Provided the table is guaranteed to have none-overlapping "playstart" and "playend" values this should work (I don't know what the name of your table is so I've used "yourtable" to represent that).
select pets from yourtable where playstart <='13:35' and playend >='13:35'
thank you Dwight Reynoldson, i will try it
– Erlina
Nov 23 '18 at 7:51
Assuming the playstart and playend columns are time data type, you can also use the syntaxSELECT pets FROM yourtable WHERE '13:35' between playstart and playend;
– Jonathan Willcock
Nov 23 '18 at 9:18
works great Dwight Reynoldson thank you
– Erlina
Nov 25 '18 at 6:19
Hi @Erlina can you please mark my answer as accepted if it has helped you out? Glad I could help.
– Dwight Reynoldson
Nov 25 '18 at 11:38
add a comment |
Please try this one, I hope this will works for you
select pets from pets where playstart >= '13:10' and endstart <= '13:50'
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53442420%2fsql-select-i-dunno-what-exactly-mean%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
In answer to the question. A select statement is a statement that aims at retrieving some data. SQL was invented to be a human readable way of interacting with databases. As such you can almost phrase your query as a question.
In this case your question would be "What pet would be played with at 13:35?".
Provided the table is guaranteed to have none-overlapping "playstart" and "playend" values this should work (I don't know what the name of your table is so I've used "yourtable" to represent that).
select pets from yourtable where playstart <='13:35' and playend >='13:35'
thank you Dwight Reynoldson, i will try it
– Erlina
Nov 23 '18 at 7:51
Assuming the playstart and playend columns are time data type, you can also use the syntaxSELECT pets FROM yourtable WHERE '13:35' between playstart and playend;
– Jonathan Willcock
Nov 23 '18 at 9:18
works great Dwight Reynoldson thank you
– Erlina
Nov 25 '18 at 6:19
Hi @Erlina can you please mark my answer as accepted if it has helped you out? Glad I could help.
– Dwight Reynoldson
Nov 25 '18 at 11:38
add a comment |
In answer to the question. A select statement is a statement that aims at retrieving some data. SQL was invented to be a human readable way of interacting with databases. As such you can almost phrase your query as a question.
In this case your question would be "What pet would be played with at 13:35?".
Provided the table is guaranteed to have none-overlapping "playstart" and "playend" values this should work (I don't know what the name of your table is so I've used "yourtable" to represent that).
select pets from yourtable where playstart <='13:35' and playend >='13:35'
thank you Dwight Reynoldson, i will try it
– Erlina
Nov 23 '18 at 7:51
Assuming the playstart and playend columns are time data type, you can also use the syntaxSELECT pets FROM yourtable WHERE '13:35' between playstart and playend;
– Jonathan Willcock
Nov 23 '18 at 9:18
works great Dwight Reynoldson thank you
– Erlina
Nov 25 '18 at 6:19
Hi @Erlina can you please mark my answer as accepted if it has helped you out? Glad I could help.
– Dwight Reynoldson
Nov 25 '18 at 11:38
add a comment |
In answer to the question. A select statement is a statement that aims at retrieving some data. SQL was invented to be a human readable way of interacting with databases. As such you can almost phrase your query as a question.
In this case your question would be "What pet would be played with at 13:35?".
Provided the table is guaranteed to have none-overlapping "playstart" and "playend" values this should work (I don't know what the name of your table is so I've used "yourtable" to represent that).
select pets from yourtable where playstart <='13:35' and playend >='13:35'
In answer to the question. A select statement is a statement that aims at retrieving some data. SQL was invented to be a human readable way of interacting with databases. As such you can almost phrase your query as a question.
In this case your question would be "What pet would be played with at 13:35?".
Provided the table is guaranteed to have none-overlapping "playstart" and "playend" values this should work (I don't know what the name of your table is so I've used "yourtable" to represent that).
select pets from yourtable where playstart <='13:35' and playend >='13:35'
answered Nov 23 '18 at 7:45
Dwight ReynoldsonDwight Reynoldson
17428
17428
thank you Dwight Reynoldson, i will try it
– Erlina
Nov 23 '18 at 7:51
Assuming the playstart and playend columns are time data type, you can also use the syntaxSELECT pets FROM yourtable WHERE '13:35' between playstart and playend;
– Jonathan Willcock
Nov 23 '18 at 9:18
works great Dwight Reynoldson thank you
– Erlina
Nov 25 '18 at 6:19
Hi @Erlina can you please mark my answer as accepted if it has helped you out? Glad I could help.
– Dwight Reynoldson
Nov 25 '18 at 11:38
add a comment |
thank you Dwight Reynoldson, i will try it
– Erlina
Nov 23 '18 at 7:51
Assuming the playstart and playend columns are time data type, you can also use the syntaxSELECT pets FROM yourtable WHERE '13:35' between playstart and playend;
– Jonathan Willcock
Nov 23 '18 at 9:18
works great Dwight Reynoldson thank you
– Erlina
Nov 25 '18 at 6:19
Hi @Erlina can you please mark my answer as accepted if it has helped you out? Glad I could help.
– Dwight Reynoldson
Nov 25 '18 at 11:38
thank you Dwight Reynoldson, i will try it
– Erlina
Nov 23 '18 at 7:51
thank you Dwight Reynoldson, i will try it
– Erlina
Nov 23 '18 at 7:51
Assuming the playstart and playend columns are time data type, you can also use the syntax
SELECT pets FROM yourtable WHERE '13:35' between playstart and playend;– Jonathan Willcock
Nov 23 '18 at 9:18
Assuming the playstart and playend columns are time data type, you can also use the syntax
SELECT pets FROM yourtable WHERE '13:35' between playstart and playend;– Jonathan Willcock
Nov 23 '18 at 9:18
works great Dwight Reynoldson thank you
– Erlina
Nov 25 '18 at 6:19
works great Dwight Reynoldson thank you
– Erlina
Nov 25 '18 at 6:19
Hi @Erlina can you please mark my answer as accepted if it has helped you out? Glad I could help.
– Dwight Reynoldson
Nov 25 '18 at 11:38
Hi @Erlina can you please mark my answer as accepted if it has helped you out? Glad I could help.
– Dwight Reynoldson
Nov 25 '18 at 11:38
add a comment |
Please try this one, I hope this will works for you
select pets from pets where playstart >= '13:10' and endstart <= '13:50'
add a comment |
Please try this one, I hope this will works for you
select pets from pets where playstart >= '13:10' and endstart <= '13:50'
add a comment |
Please try this one, I hope this will works for you
select pets from pets where playstart >= '13:10' and endstart <= '13:50'
Please try this one, I hope this will works for you
select pets from pets where playstart >= '13:10' and endstart <= '13:50'
answered Nov 23 '18 at 11:22
HARSHIT RATHOREHARSHIT RATHORE
265
265
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53442420%2fsql-select-i-dunno-what-exactly-mean%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What data type in date column?
– dwir182
Nov 23 '18 at 7:37
1
Try to make your question title more closely reflect your actual question. "i dunno what exactly mean" isn't very useful for searching on.
– Nick
Nov 23 '18 at 7:38