Data dodania Pytanie
2017-03-18 13:03 Select query from nested table of references »
I have two object-relational tables: person_table and account_table, built out of objects person and account. An account row has a nested table for al...
(1) odpowiedzi
2017-03-17 21:03 Postgresql dense_rank manipulation »
I have a table like this: Name | Time | Sam | 10:58 | Sam | 10:59 | Sam | 11:10 | Tom | 1:16...
(2) odpowiedzi
2017-03-17 18:03 SQL Server ORDER BY - Sequencing ordering method »
I have some trouble with SQL Server. I have these numbers in a column: |numbers |1 |1 |1 |1 |2 |2 |2 |3 I would like to order like this: |numbers...
(2) odpowiedzi
2017-03-17 14:03 Find all tables containing stringA, excluding tables having columns with a name like stringB »
I want to find all tables with a name like %ABC% but excluding table_name:s that have any column with a name like %USER% I try to join dba_tables wit...
(3) odpowiedzi
2017-03-17 09:03 Select parent row cell value for child row in MySQL »
I am importing data from an Excel sheet, and I am at a point where I have one table with parent and child rows. Child rows have around the same column...
(4) odpowiedzi
2017-03-17 09:03 How to get all columns which are nearly as long as the maximum allowed size »
Is it possible to get all columns (varchar2, char, nvarchar2), where the data is as long (or nearly as long - 2 characters less) than the allowed maxi...
(2) odpowiedzi
2017-03-16 14:03 DDL Trigger which grants permission to new created users »
I got a question, is there a possibilty, that a DDL Trigger can grant roles right after the user is created. For example: CREATE OR REPLACE TRIGGER ...
(1) odpowiedzi
2017-03-16 12:03 Delete post with smallest id SQL »
Delete from post where id_post in ( select MIN(id_post) from post where id_owner='2' ) Returns: "You can't specify target table 'pos...
(2) odpowiedzi
2017-03-16 12:03 Multiple SQL Statements in Java (with ?allowMultiQueries=true) »
I have a question. I work with a lot of SQL Queries and try to work out the best and fastest solution to handle a lot of queries (about 10'000 SQL-que...
(1) odpowiedzi
2017-03-16 09:03 Completing the missing rows when outer joining to a table of counts »
I have a problem with an OUTER JOIN not providing enough empty rows. The business context is users starting (and hopefully finishing) online tests. E...
(2) odpowiedzi
2017-03-16 03:03 How will I remove nulls from each columns »
How will I remove nulls from each columns This is the example Column 1 Column 2 column 3 column 4 a 1 null null b ...
(1) odpowiedzi
2017-03-15 22:03 Let's see if you can solve this one, open items hell »
I am trying to calculate Open column based on the following scenario. For a unique sales order + sales_order_item, if Billed_Item is NULL, Open = Or...
(2) odpowiedzi
2017-03-15 13:03 How to use IN clause with multiple columns on same data in postgresql? »
I have a query like this: SELECT c1 from t WHERE c2 IN list1 AND c3 IN list1; I want to combine this query to get somthing like this: SELECT c1 fr...
(2) odpowiedzi
2017-03-15 13:03 Inner Joins and retrieving the parent record if only its children record met certain criteria »
Table CP CP_Name CP_Number CP_PK ------- --------- ----- AA 111 123 BB 222 124 CC 333 125 DD ...
(3) odpowiedzi
2017-03-15 12:03 SQL INNER JOIN vs Where Exists Performance Consideration »
Suppose, I have a list of string which is sent from client, in this case regions. And I have a table named Compliance Regions. I want to search for th...
(3) odpowiedzi
2017-03-15 09:03 Optimizing Rails Query »
is there anyway else to optimize this query? It takes about 44ms to run but would love for it to be much lower. Any ideas?? @@accepted_list = Histor...
(0) odpowiedzi
2017-03-14 22:03 How to Never Retrieve Different Rows in a Changing Table »
I have a table of millions of rows that is constantly changing(new rows are inserted, updated and some are deleted). I'd like to query 100 new rows(I ...
(2) odpowiedzi
2017-03-14 18:03 Mode over a one year window in PostgreSQL »
I have a Redshift table of transactions from members, and associated to each transaction is a state: date|member_id|transaction_amount|state --...
(1) odpowiedzi
2017-03-14 17:03 SQL + Rails - is it posible to get a collection of objects with the values of attributes from other table columns »
class Baby belongs_to :child attr :is_public scope :public, includes(:child).merge(Child.public).where('babies.is_public IS TRUE') end class Ch...
(1) odpowiedzi
2017-03-14 15:03 MySQL fast check if hash exists »
I'm trying to create a MySQL function which takes n and m as input and generates random n unique combinations of m ids from result of query. The func...
(2) odpowiedzi
2017-03-14 12:03 TIMEOUT issue while searching data from SQL Server when insert update commands being executed »
I have a Windows service developed in C#. This service imports data from XML files into a SQL Server database, into different tables. These XML files ...
(6) odpowiedzi
2017-03-14 10:03 How does a recursive correlated expression speed up distinct queries? »
I found this post about speeding up distinct queries: Super-fast DISTINCT using a recursive CTE: USE tempdb; GO DROP TABLE dbo.Test; GO CREAT...
(1) odpowiedzi
2017-03-14 05:03 Need to write subquery to calculate income for each month »
My table is like summa_som date_operation ----- -------------- 100 11/03/2005 500 13/07/2008 900 12/11/2015 Expe...
(2) odpowiedzi
2017-03-14 01:03 Generating string of numbers in random order »
I need to generate a string of the numbers 1-3 with the numbers in random order for each row selected from a table. I have tried the following, but a...
(2) odpowiedzi
2017-03-13 22:03 How to get value of a key inside an jsonb array in postgres and JOIN »
I have data that looks like inside a json table in postgres with a column called content has data similar to {schd:[{key1:val1, key2:val2}]} The w...
(1) odpowiedzi
2017-03-13 11:03 updating last 2 char in varshar »
I want to make this update update c_order set documentno = 'OV1036477' where documentno = 'OV1036503'; update c_order set documentno = 'OV1036476' w...
(3) odpowiedzi
2017-03-13 10:03 Rails .where() query not working »
Thanks a lot for your help. I have a locations and ads table. Location has_many :ads I perform the following query on Location Model. @locations = Lo...
(1) odpowiedzi
2017-03-13 08:03 ORA-00918: column ambiguously defined when choose a list of paramlistpa »
I know this question has been asked multiple times before, but I've seen every discussion about this here but none could help me to solve my problem. ...
(0) odpowiedzi
2017-03-12 21:03 Need assistance with this SQL query »
This is an example of my table. I have multiple entries on multiple rows for a given post_id (this is metadata for posts). post_id | meta_key | meta_...
(5) odpowiedzi
2017-03-12 01:03 Oracle SQL - how to select and combine data from multiple rows »
The scenario is that for a particular date range, I need to return all rows where a field value has changed (FROM and TO date). The changed field valu...
(2) odpowiedzi
2017-03-11 17:03 difference between null vs white space? »
suppose if i create a table with primary key I can't insert null and duplicate values. But i can insert white spaces. eg: insert into table_name valu...
(3) odpowiedzi
2017-03-11 15:03 Postgresql - Opposite of string_agg »
I'm looking for a postgresql function that will do the opposite of string_agg. I have a movies table where the tags column contains values such as ...
(2) odpowiedzi
2017-03-11 12:03 How do i add a constraint in Oracle SQL to limit a value? »
How can i set a column in oracle to not accept numbers above 10000 and below 0? ...
(1) odpowiedzi
2017-03-11 06:03 How to parse below xml in oracle sql »
<root> <transactiondata> <Info> <![CDATA[1234ABCD]]> <Details> <Data Name="Names"> <FirstNam...
(1) odpowiedzi
2017-03-11 00:03 Alternative to BigQuery for medium-sized data »
This is a follow-up to the question Why doesn't BigQuery perform as well on small data sets. Let's suppose I have a data-set that is ~1M rows. I...
(7) odpowiedzi