ked IMMUTABLE
How can I fix this?
> On Nov 8, 2017, at 4:02 PM, Arup Rakshit wrote:
>
> Hi,
>
> I do have a videos table, and it has a column called `tags` of type array. I
> would like to select all videos where any string inside tag column matches a
> given substri
Hi,
I do have a videos table, and it has a column called `tags` of type array. I
would like to select all videos where any string inside tag column matches a
given substring. What method should I use? The *Contains `@>` operator* will do
full string comparisons as far as I understood.
--
Sent
Hello,
Below is my table structure:
musedb_dev=# \d kudosposts
Table "public.kudosposts"
Column|Type |Modifiers
--+-+--
mission_status
FROM missions
LEFT JOIN member_submissions ON missions.id = member_submissions.mission_id
WHERE missions.track_id = 7
But still would like to know why it didn’t work with JOIN.
Thanks,
- A
On Jun 24, 2017, at 10:30 PM, Adrian Klaver
mailto:adrian.kla...@aklaver.com>> wrote:
On
Hi,
Thanks everyone for taking time to explain this. I tried to add a case
statement and getting errors. Can you tell me how should I add a column to mark
which mission is completed and which is not. My try is not working. Instead of
the new CASE expression, the query works as expected.
SELECT
Hi David,
Can you tell me how can I add ordering between LEFT and INNER JOIN. I think
also that is where I am wrong, but not sure how to correct the ordering.
Thanks,
A
On Jun 24, 2017, at 3:18 AM, David G. Johnston
mailto:david.g.johns...@gmail.com>> wrote:
On Friday, June 23, 2017
Hi,
I have this relationship Track has many missions. Missions has many
submissions. Each Submission has one member and one mission. Say I have track
id 7. I want to find out which missions under track 7 are submitted by John ( a
user id say 3 ) and which are not yet. I tried a query, but it is
Hi Tom,
Thanks, I’ll read this page.
> On May 28, 2017, at 8:36 PM, Tom Lane wrote:
>
> Arup Rakshit writes:
>> I was reading to day how indexing works. And I was trying some query, for
>> example below one. What the range basically means (cost=0.28..8.30 ? I don’
Hi,
I was reading to day how indexing works. And I was trying some query, for
example below one. What the range basically means (cost=0.28..8.30 ? I don’t
understand this.
———
arup@ror ~/part-time-projects/entrylvl (add_index_to_job_sources)$ rails db
psql (9.5.0)
Type "help" for he
#x27;t work out.
----
Regards,
Arup Rakshit
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
is "Arup". Now from this row, I want to
delete all next rows where the content is "Arup". How should I achieve this?
Regards,
Arup Rakshit
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Hi,
Suppose I have a column t1 for a table. Now t1 holds some numerice value for
each row. Say R1 to R5 records has values for the column t1 as :
t1(2,5,8,10,32)
I want the result to be printed as (10, 32, 8, 2, 5) means - Big, Biggest,
small ,
Regards,
Arup Rakshit
--
Sent via pgsql
und.
[arup@music_track (master)]$
--
Regards,
Arup Rakshit
Debugging is twice as hard as writing the code in the first place. Therefore,
if you write the code as cleverly as possible, you are, by definition, not
smart enough to debug it.
--Brian Kernighan
--
Sent
Hi,
This says if matched found or not against the input array :
'{"a":1, "b":2, "c":3}'::jsonb ?| array['b', 'c']
But how would I determine how many matched ? Like for the above example, I see
only 2 matched found.
--
==
;
--
Regards,
Arup Rakshit
Debugging is twice as hard as writing the code in the first place. Therefore,
if you write the code as cleverly as possible, you are, by definition, not
smart enough to debug it.
--Brian Kernighan
--
Sent via pgsql-general mailing list (pgsql
I am not sure, if it is the correct way to do it or how it
will hit the performance.
The Application can run on different OS. So I am helpless to use Unix commands.
--
Regards,
Arup Rakshit
Debugging is twice as hard as writing the code in the first place. There
On Sunday, May 24, 2015 07:24:41 AM you wrote:
> On 05/24/2015 04:55 AM, Arup Rakshit wrote:
> > On Sunday, May 24, 2015 02:52:47 PM you wrote:
> >> On Sun, 2015-05-24 at 16:56 +0630, Arup Rakshit wrote:
> >>> Hi,
> >>>
> >>> I am copying th
On Sunday, May 24, 2015 02:52:47 PM you wrote:
> On Sun, 2015-05-24 at 16:56 +0630, Arup Rakshit wrote:
> > Hi,
> >
> > I am copying the data from a CSV file to a Table using "COPY" command.
> > But one thing that I got stuck, is how to skip duplicate records
please share.
Thanks in advance!
--
========
Regards,
Arup Rakshit
Debugging is twice as hard as writing the code in the first place. Therefore,
if you write the code as cleverly as possible, you are, by definition, not
smart enough to debug it.
--Brian Kernighan
-
On Monday, March 30, 2015 06:27:19 AM Adrian Klaver wrote:
> On 03/30/2015 01:09 AM, Arup Rakshit wrote:
> > Hi,
> >
> > I am trying to follow what has been mentioned below **Setting Up Postgres**
> > (https://www.digitalocean.com/community/tutorials/how-to-setup-
(add_postgres_addapter)]$
It is asking me the password, whereas I don't know the password of the user
`postgres`. How would I create a new role with a password in this case ?
I am using OS X version 10.8.2
Regards,
Arup Rakshit
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To
pose I want to update the record#1 and # 2 as {"a": 12} and {"a": 2,
"b": ["c", "d"]} .. What is the way to update this ?
--
Regards,
Arup Rakshit
Debugging is twice as hard as writing the code in the first place.
On Tuesday, February 24, 2015 06:14:53 PM Andreas Kretschmer wrote:
> Arup Rakshit wrote:
>
> > This *FILTER* method is available from 9.4, How can I get the same output
> > below 9.4 version ?
>
>
> case when ...
>
> see:
> http://www.cybertec.at/postgr
On Tuesday, February 24, 2015 06:14:53 PM Andreas Kretschmer wrote:
> Arup Rakshit wrote:
>
> > This *FILTER* method is available from 9.4, How can I get the same output
> > below 9.4 version ?
>
>
> case when ...
>
> see:
> http://www.cybertec.at/postgr
On Tuesday, February 24, 2015 06:13:21 PM Pavel Stehule wrote:
> Hi
>
> 2015-02-24 17:02 GMT+01:00 Arup Rakshit :
>
> > Hi,
> >
> > Please look at my query :
> >
> > [shreyas@rails_app_test (master)]$ rails db
> > psql (9.4.1)
> > Typ
How can I get the same output below
9.4 version ?
--
Regards,
Arup Rakshit
Debugging is twice as hard as writing the code in the first place. Therefore,
if you write the code as cleverly as possible, you are, by definition, not
smart enough to debug it.
--Bria
On Saturday, February 21, 2015 12:42:03 PM Alban Hertroys wrote:
>
> > On 21 Feb 2015, at 9:34, Arup Rakshit wrote:
> >
> > Select * from Emp
> > where (attr1 = val11 and attr2 = val12 and attr3 = val13) or (attr1 =
> > val14and attr2 = val15 and attr3 = val16
wired.
Any better way to get it done ?
--
Regards,
Arup Rakshit
Debugging is twice as hard as writing the code in the first place. Therefore,
if you write the code as cleverly as possible, you are, by definition, not
smart enough to debug it.
--Brian Kernighan
On Sunday, December 28, 2014 01:24:00 PM you wrote:
>
> > On 28 Dec 2014, at 12:06, Arup Rakshit wrote:
> >
> > Now I have another problem:
> >
> > prac_db=# SET datestyle = "SQL, DMY";
> > SET
> > prac_db=# copy orders from '/home/a
ivery_address | text |
order_date | date |
delivery_date| date |
status | text |
delivery_time| time without time zone |
courier_id | integer|
Indexes:
"orders_pkey"
rameter "DateStyle": "ISO, BIS IS 7900:2001"
DETAIL: List syntax is invalid.
prac_db=#
My Data style inside the CSV exactly like -
http://en.wikipedia.org/wiki/Date_and_time_notation_in_India. How to fix this
problem?
--
Regards,
Arup Rakshit
Debugging is twi
On Saturday, December 20, 2014 12:53:44 AM Arup Rakshit wrote:
> On Saturday, December 20, 2014 12:40:08 AM Arup Rakshit wrote:
> > Hi,
> >
> > I need to uninstall postgresql. I downloaded using
> > http://www.enterprisedb.com/products-services-training/pgdownload
On Saturday, December 20, 2014 12:40:08 AM Arup Rakshit wrote:
> Hi,
>
> I need to uninstall postgresql. I downloaded using
> http://www.enterprisedb.com/products-services-training/pgdownload . But now
> I want to uninstall it. As there are no uninstaller, I am thinking to
> i
I have to remove? Or is there any other
safe approach or not ?
--
Regards,
Arup Rakshit
Debugging is twice as hard as writing the code in the first place. Therefore,
if you write the code as cleverly as possible, you are, by definition, not
smart enough to
ORDER BY parent_id, id ?
François Beausoleil
parent_id .. But why order_by.. I thought I need to group by
parent child email
1 2 te...@test.com
3 email
How can I group all children by their parent ?
id email parent_id
1 t...@test.com nil
2 te...@test.com 1
3 email 1
4 email 2
5 email nil
6 email 3
Regards,
Arup Rakshit
On Thursday, July 03, 2014 11:49:04 AM John R Pierce wrote:
> On 7/3/2014 8:24 AM, Arup Rakshit wrote:
> >> OT, but it boggles my mind that anyone thinks thats 'better' than the
> >>
> >> >straight SQL
> >
> > I would like to see your
On Thursday, July 03, 2014 09:04:36 AM John R Pierce wrote:
> On 7/3/2014 4:01 AM, Arup Rakshit wrote:
> > Exactly.. I am done. Here is the ORM query :-
>
> OT, but it boggles my mind that anyone thinks thats 'better' than the
> straight SQL
I would like to see your
Are you sure this is what you want?
Since there are two columns you will have to either use a CASE or a
sub-select to facilitate calculating the values for each of the columns.
SELECT gender, answer1_avg, answer2_avg
FROM (SELECT DISTINCT gender FROM ...) gn
LEFT JOIN (SELECT gender, answer1
On Thursday, July 03, 2014 09:04:36 AM John R Pierce wrote:
> On 7/3/2014 4:01 AM, Arup Rakshit wrote:
> > Exactly.. I am done. Here is the ORM query :-
>
> OT, but it boggles my mind that anyone thinks thats 'better' than the
> straight SQL
I would like to see your
Hi,
Could you have multiple row with same answer ?
If I understand you one row and N + 1 column where N is the number
of answer ?
Regards
You are right. Current it is fixed 2 answer. It means N = 2.
Hi,
One query is producing the below table :-
answer | count | avg
a1 3 14
a2 2 10
How to convert this to a single row table ?
count | avg_a1 | avg_a2
5 14 10
Regards,
Arup Rakshit
rent query. I don't understand which average value for
which answer.
Can we make the output as below ?
genderparticipants answer1_avg answer2_avg
n 3 12 3
m 5 4
Without commenting on the rest of it...to combine what you show here just
GROUP BY gender and SUM() everything else (i.e., turn the above into a
subquery and then do this)
David J.
Exactly.. I am done. Here is the ORM query :-
def self.employee_learning_by_gender(question_id)
cpd_id =
Are you sure this is what you want?
Since there are two columns you will have to either use a CASE or a
to facilitate calculating the values for each of the columns.
SELECT gender, answer1_avg, answer2_avg
FROM (SELECT DISTINCT gender FROM ...) gn
LEFT JOIN (SELECT gender, answer1_avg FROM
se either of
the answer type, but not the both. So, if any female F1 provides 80 to A2, in
that day, she wouldn't be allowed to answer for A1.
Same stands for male and also.
--
Regards,
Arup Rakshit
Debugging is twice as hard as writing the code in the fi
se either of
the answer type, but not the both. So, if any female F1 provides 80 to A2, in
that day, she wouldn't be allowed to answer for A1.
Same stands for male and also.
--
Regards,
Arup Rakshit
Debugging is twice as hard as writing the code in the fi
On Wednesday, July 02, 2014 02:49:54 PM you wrote:
> On Wed, Jul 2, 2014 at 1:44 PM, Arup Rakshit
>
> wrote:
> > *group by* on full table(*users*). I am away from our production DB. Could
> > you
> > tell me how this little change will solve the whole problem and help
hole problem and help me to get
the data as per the format I am looking for.
--
====
Regards,
Arup Rakshit
Debugging is twice as hard as writing the code in the first place. Therefore,
if you write the code as cleverly as possible, you are, by definition, not
sma
rent query. I don't understand which average value for
which answer.
Can we make the output as below ?
genderparticipants answer1_avg answer2_avg
n 3 12 3
m 5 4
On Wednesday, July 02, 2014 08:42:43 AM Steve Crawford wrote:
> On 07/01/2014 11:27 PM, Arup Rakshit wrote:
> > Here is my try :
> >
> > staging::=> select to_char(created_at,'DD/MM') || '/' ||
> > to_char(now(),'') as when from us
Here is my try :
>
>
>staging::=> select to_char(created_at,'DD/MM') || '/' ||
>to_char(now(),'') as when from users;
> when
>
> 24/02/2014
> 28/02/2014
> 02/03/2014
> 01/03/2014
> 04/03/2014
> 02/03/2014
> 06/03/2014
> 07/05/2014
> 02/06/2014
> 06/06/2014
> 20/02/2014
>
14
20/02/2014
20/02/2014
20/02/2014
20/06/2014
20/02/2014
(15 rows)
Can the same be done using any other clever trick ?
Regards,
Arup Rakshit
pleted 5 and 10 years. Thus my output should come as
Name milestoneswhen
Ram 512/04/2014
Shyam 5 21/04/2014
Ayan10 12/04/2014
--
Regards,
Arup Rakshit
Debugging is twice as hard as writing the code in the first place. Th
s feel
like ok, sometimes not. :-)
--
Regards,
Arup Rakshit
Debugging is twice as hard as writing the code in the first place. Therefore,
if you write the code as cleverly as possible, you are, by definition, not
smart enough to debug it.
--Brian
/2014 completed 15 years
Foo_4 on 21/3/2014 completed 5 years
They should come in the output
Regards,
Arup Rakshit
I have employee table. Where I have a column joining_date. Now I am looking for
a way to get all employee, who completed 5 years, 10 years current month. How
to do so ? I am not able to figure this out.
Regards,
Arup Rakshit
ears | 1
00:00:00 | 1
(6 rows)
Question -
(a) How to convert age to 1 year when age will come as 00:00:00 or calculate
the age in years in with rounding like 0.4, 0.5, 47.3 years like that ?
(b) Why group by didn't group all '00:00:00' ?
Regards,
Arup Rakshit
is to
> post your reply at the bottom and not to top-post.
>
Yes, you are correct. Otherwise it is very hard to follow.
One suggestion I need from you. Would it be a good to start straight from
doco, or should I start from a book ?
Again thanks for writing .
--
====
Reg
row)
Is it correct ? I am new pgdql DB :-) Awesome DB it is...
Regards,
Arup Rakshit
On Friday, 20 June 2014 12:22 PM, Michael Paquier
wrote:
On Fri, Jun 20, 2014 at 3:42 PM, Arup Rakshit
wrote:
> How can I get first day date of the previous month. Last day of previous
> mo
How can I get first day date of the previous month. Last day of previous month
can be found using the answer - http://stackoverflow.com/a/8945281/2767755
Regards,
Arup Rakshit
-# ;
id
5
(1 row)
How would I select rows which has empty array for the field "team_ids" ?
Regards,
Arup Rakshit
::integer[];
id | workplace_ids
+---
(0 rows)
yelloday_development=# select id, workplace_ids from reporting_groups where
workplace_ids && ARRAY[1,4,5]::integer[];
id | workplace_ids
+---
4 | {1}
(1 row)
Rega
mp;&
workplace_ids)
ActiveRecord::StatementInvalid: PG::UndefinedFunction: ERROR: operator does
not exist: text[] && integer[]
LINE 1: ...ps".* FROM "reporting_groups" WHERE (ARRAY[NULL] && workpla...
le I gave
above is the same as per our current query in production.
Regards,
Arup Rakshit
On Monday, 2 June 2014 9:04 PM, Steve Crawford
wrote:
On 06/02/2014 03:54 AM, Arup Rakshit wrote:
Hi,
>
>
>Suppose, I have a table as below :-
>
the one I need really. It worked. Great DB it is. Lots of utility
methods.
--
Regards,
Arup Rakshit
Debugging is twice as hard as writing the code in the first place. Therefore,
if you write the code as cleverly as possible, you are, by definition, not
smart en
| { banana, lemon }
4 | third post | foo baz | { watermelon, lemon }
Now I want to select all rows, for which tags will having either one or all
value from the this array [apple,banana] ? how should I write the query using
such a set ?
output should select 1,2,3.
Regards,
Arup
67 matches
Mail list logo