Data dodania Pytanie
2017-10-12 18:10 How to join self join with subquery? »
Data: create table `values` ( id integer unsigned primary key auto_increment, value double, `time` time ); insert into `values` (time...
(1) odpowiedzi
2017-10-12 18:10 Oracle SQL: How to check if a calendar week is in between two calendar weeks »
I want to check if a calendar week is in between two calendar weeks using PL/SQL. Let's say the calendar week I want to check is 26. When I check if...
(2) odpowiedzi
2017-10-12 15:10 Does executing as a script mean all my fields become data type of VARCHAR2? »
I'm running a script in Toad for Oracle. I have two main options to run the script: Hotkey F9: Execute Statement Hotkey F5: Execute as Script "Ex...
(1) odpowiedzi
2017-10-12 13:10 Sql query didn't get proper payment method »
I got issue while i execute my sql query with paymentmethod 1 show it's show paymentmethod 3 also. Please Check where i am wrong. Thanks in advance ...
(2) odpowiedzi
2017-10-12 13:10 How can I use GREATEST and LEAST in a Rails migration? »
I need to ensure bi-directional uniqueness within a table friendships on the columns requester_id and accepter_id. Table: friendships requester_id |...
(1) odpowiedzi
2017-10-12 12:10 Count how many times a value occurs across tables »
First post here! Really need some help. I have a table with buildings. In this table, there is a number of attributes, of which I am interested in 2...
(1) odpowiedzi
2017-10-11 20:10 SQL Query Inner Join and OR »
How do i select using INNER JOIN and OR, i tried using below query but it doesn't return anything also no error SELECT * FROM chatroom_message cm INN...
(4) odpowiedzi
2017-10-11 12:10 CFML & SQL - Performance Increase? »
Brief Overview Okay, so I've written a query that will filter some products, however, I need to try and further tweak this query to allow for even mo...
(2) odpowiedzi
2017-10-11 11:10 why addition need to check null but sum not need to check null? »
select sum(a) from Sometime when Sum, we don't need to check null value, but in add we need to check, who can tell me why? example Sum we don't need ...
(3) odpowiedzi
2017-10-11 08:10 How to count record month group with unix timestamp in php & mysql. »
Example my_table ID | Name | Date -------------------------- 12 | John | 123456789 13 | Mike | 987654321 ... 29 | Rick | 123498765 30 | Adam | 987651...
(2) odpowiedzi
2017-10-10 17:10 Postgresql equivalent to sp_MSforeachdb »
I am working in a complex PostgreSQL 9.4 environment, and I need to run the equivalent of the command below using pgAdmin III exec sp_MSforeachdb 'SE...
(0) odpowiedzi
2017-10-10 16:10 query get records lesser than SQL »
This query which get records of all clubs, i check record per records. The NULL columns doesn't play any role. Howerver i filled NULL's. This mean any...
(1) odpowiedzi
2017-10-10 13:10 PostgreSQL Parametric Window Size »
Does anyone know if SQL Standards define and PostgreSQL will implement (10.x or higher) Parametric Window Size? Bellow a MVE of what I call a paramet...
(1) odpowiedzi
2017-10-10 13:10 PL/SQL - Can you access certain record in a cursor by index? »
I am trying to write a test, and given a group of reviews, I want to set 1 of them to 'Status A' and all of the rest to 'Status B'. I know for PL/SQL,...
(3) odpowiedzi
2017-10-10 12:10 Oracle query row order is different when using between with ROW_NUM »
I am using Between condition in ORACLE, to achieve pagination. I will sort data on CNT column in descending order to display most counted value first....
(2) odpowiedzi
2017-10-10 11:10 How to have SQL query with 2 subqueries divided »
I have a database which has these tables: Users (id, email) Trips (id, driver_id) MatchedTrips (id, trip_id) I need to get for each user the total...
(2) odpowiedzi
2017-10-10 10:10 How to delete record when there is a deadlock of foreign keys? »
I have two tables p and u as following: (PostgreSQL 9.3) CREATE TABLE p ( pid integer NOT NULL, uid integer, CONSTRAINT p_fkey FOREIGN KEY (uid...
(2) odpowiedzi
2017-10-10 07:10 How to append object in postgresql jsonb field while update »
I want to update my jsonb field it store array of object. i want to add new object in it. CREATE TABLE justjson ( id INTEGER, doc JSONB); INSERT INTO...
(1) odpowiedzi
2017-10-09 18:10 Grouping Query with Has Many Relations in Rails »
I have a has_many, through: relationship between Projets and Categories using a Categorization model. A Projet belongs_to a Client. class Client <...
(1) odpowiedzi
2017-10-09 17:10 Postgres: count unique array entries from subquery »
If my subquery foo liberates the rows:- ID, USERS 1 {23129} 2 {23142} 3 {23300,23300} 4 {23129,23300} How can I get a count of unique user...
(3) odpowiedzi
2017-10-09 13:10 Show whitespaces in dropdown list in razor page »
I have a query in SQL that return the name of my organizations with whitespaces Sql. In my asp net core project i need to show in a dropdown list all...
(1) odpowiedzi
2017-10-08 23:10 MYSQL select count(*) in one table if id exists in another table »
This should be really simple but I'm stuck on it and couldn't find the answer here. I want to count the number of records in one table that match a ...
(2) odpowiedzi
2017-10-08 23:10 Design for relation database with object structure »
I am designing database for my app. I am using PostgreSQL. It has to be generic app and real world structure looks like this: Category (e.g. vegetati...
(1) odpowiedzi
2017-10-08 15:10 PostgreSQL - Grant select on all tables (and future tables), in *all schemas* »
My database uses schemas to separate tenant-specific data for an application - each customer has a brand new schema created when they sign up to hold ...
(1) odpowiedzi
2017-10-08 13:10 Get records within specific year and month »
I'm having this class method for filtering records that belong to specific year and month @posts = Post.filtered(params).published def self.filter...
(2) odpowiedzi
2017-10-08 10:10 Fetch column with maximum value for a column & then maximum value of another column »
My Table: create table temp_table_name (seq number(10), start_Date date, end_date date, param varchar2(10)) My PK: alter table temp_table_name ad...
(0) odpowiedzi
2017-10-07 17:10 MySQL Update IF (ROW_COUNT() = 0) »
I have this SQL : UPDATE gcd_data SET post_title = 'Hello World', post_content = 'How Are You?', post_date_gmt = '', post_modified_g...
(1) odpowiedzi
2017-10-07 17:10 How should I make a follow system sql or nosql? »
I'd like to programm a system where a user can follow another user but I don't know if I should do it with a nosql db like mongodb or any other or is ...
(1) odpowiedzi
2017-10-07 13:10 Need ALTER TYPE query to update a existing field in existing object »
I have already created a TYPE object Example1 using the following query CREATE OR replace type example1 AS OBJECT ( emp_name varchar2(32), emp_...
(1) odpowiedzi
2017-10-07 13:10 How to get rows matching a condition using a hierarchical query »
Consider the following query from Oracle documentation https://docs.oracle.com/cd/B19306_01/server.102/b14200/queries003.htm SELECT employee_id, last...
(1) odpowiedzi
2017-10-07 08:10 How to schedule Oracle DBMS Jobs in a window »
I want to create an Oracle DBMS Job that runs every week day (not on weekends) from 09:00 to 20:00 every 10 min. I wonder if I can do that in the FREQ...
(2) odpowiedzi
2017-10-06 21:10 Why do you need to include a field in GROUP BY when using OVER (PARTITION BY x)? »
I have a table for which I want to do a simple sum of a field, grouped by two columns. I then want the total for all values for each year_num. See ex...
(1) odpowiedzi
2017-10-06 12:10 MySQL Group By Query X or not X »
This should be easy but I have not found the answer. I have a query that is running a count and I want to group this within the query into those where...
(4) odpowiedzi
2017-10-06 10:10 Oracle 11g: query performance optimization »
I have performance problem with this specific query: SELECT ID, NAME, CREATION_DATE, MODIFICATION_DATE, CREATION_USER, ...
(1) odpowiedzi
2017-10-06 00:10 Using "BEGIN" keyword improperly »
I am getting an error in the code below. I have added an arror <------ where the problem is. The error message says that a THEN is expected, but w...
(3) odpowiedzi