Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
1
vote
0
answers
202
views
Real Time data collection - Help select Database
Any help and suggestions are really appreciated. …
2
votes
1
answer
1k
views
Help with SELECT queries
I need help with some queries. I struggled do find out how to do it, but I think I finally caught on or at least got the results I was looking for in the database. … select SNO
from SPJ
Where JNO = 'J2'
Order by SNO ASC;
2) Get part numbers for parts supplied by a supplier in LA
select DISTINCT PNO
from spj
where SNO in
(select SNO
from Suppliers
where CITY …
0
votes
1
answer
169
views
Help needed to raise performance Postgres SELECT
We always do a SELECT ... WHERE timestamp_to .. AND statcode= ... AND component=...
It returns approx 370 records. These are hourly values over two weeks (24x14). … The full SELECT is:
SELECT statcode, meetwaarde, extract(epoch from timestamp_to AT TIME ZONE 'UTC' AT TIME ZONE 'Europe/Amsterdam')*1000 as tijd
FROM lml_data
WHERE (statcode = 'NL10937' OR statcode …
2
votes
1
answer
77
views
Do id columns help (in speed) select statements?
I thought of adding an ID column (pk, ai, nn) as of it will be make the select queries faster.
What do you think about it? do you have any advice how more I can optimize this table? …
1
vote
1
answer
1k
views
Help me about syntax STUFF (SELECT... for XML PATH)
'o1', 'p1', 10
union all
select 'o1', 'p2', 20
union all
select 'o1', 'p3', 20
union all
select 'o2', 'p1', 10
union all
select 'o2', 'p2', 10
union all
select 'o3', 'p1', 10
insert into products
select … Please help me, thanks so much! …
5
votes
2
answers
132
views
Does a covering nonclustered index help to answer Select * queries?
Our application developers run a lot of SELECT * queries against our database system, unfortunately. … I know it is not best practice and bad design to support those queries, but I doubt this could be changed within adequate time, so I wonder if those indexes will help at all or produce more costs than …
4
votes
1
answer
36k
views
Select data from the previous 3 months [duplicate]
I need help selecting data where the date is in the previous 3 months. (note: I'm not asking for the last 3 months i.e. …
3
votes
4
answers
16k
views
Selecting dates that are between the previous 12 to 9 month range
I need help selecting dates that are between the previous 12 to 9 month range. As an example if today is 2-22-2017 I need to pull a date range from 2-1-2016 to 3-31-2016. … I can select all dates from the previous 12 months using this:
WHERE READDATE >= DATEADD(month, DATEDIFF(month, 0, DATEADD(MONTH,-12,GETDATE())), 0)
AND READDATE <= DATEADD(s,-12,DATEADD(MONTH, DATEDIFF …
0
votes
1
answer
44
views
Help writing a query that select the min column in a group by
The query should return the user and the lowest price of its services
Here is the query I wrote, as you can see i have wrote a sub select and I was wondering if this is a good way of doing things? … SELECT
u.id,
u.nickname,
(select MIN(price) from user_service where user_id=u.id order by price desc) as minPrice
FROM
user u
LEFT JOIN user_service us ON us.user_id = u.id …
1
vote
1
answer
42
views
MySQL Help - Combining 2 MySQL Selects - Result in 1
I'm not sure how to construct this and was hoping for some help. … I nearly achieved it with the below SQL (except it's giving a result for each entry in the table) :(
select
case
when (select count(*) from monitor
where exists (select * from monitor where name = 'job1 …
1
vote
1
answer
69
views
Selecting latest row for user grouped by day help
Hoping someone can help me here as I can't quite wrap my head around the best way to do this. … SELECT
SUM((DATA ->> 'score')::integer) AS score,
count(*) as count,
created_at::date
FROM
scores
GROUP BY created_at::date …
2
votes
1
answer
259
views
help in correcting the syntax error of the below create table with as with multiple select [closed]
Please help to correct the syntax of the below. I am from a math background trying to use Oracle. The command helps me permute the columns and put them in one table. … create table newsample AS
(
select(
(select h1.E1,h1.E2,h1.E3,h1.E4 from sample1 h1),
(select h1.E1,h1.E2,h1.E4,h1.E3 from sample1 h1),
(select h1.E1,h1.E3,h1.E2,h1.E4 from sample1 h1),
(select h1.E1 …
3
votes
2
answers
1k
views
SQL Server 2012 - Frequent SELECT and UPDATE on bit column. Index doesn't help
:
CREATE TABLE Documents (
documentId bigint IDENTITY NOT NULL,
content nvarchar(MAX) NOT NULL,
isIndexed bit NOT NULL
)
I have a separate Lucene-based indexer process that does this:
SELECT …
2
votes
1
answer
1k
views
Help with a complicated MySQL Query inserting data using select from 2 tables
My First Query:
INSERT INTO player_list_items
(player_list_list_id, player_list_player_id, player_list_item_id, player_list_item_cellX, player_list_item_cellY)
SELECT li.list_item_list_id, 584488596 … , game_map_details.cellX, game_map_details.cellY
FROM list_items
JOIN (SELECT * FROM game_map_details WHERE map_id = 1 ORDER BY RAND()) AS game_map_details
WHERE list_item_list_id = 2
GROUP BY list_item_item_id …
0
votes
Separating Numeric Values from string
I never used sql server myself (only PostgreSQL , Oracle and Mysql), but i think this will help:
select substring([col], PatIndex('%[0-9]%', [col]), len([col]))
where col is a string 'BP00005' …