« first day (1900 days earlier)      last day (2418 days later) » 

05:40
@Shaneis what? what's the purpose / concept of using inner join in Delete?
user7912927
05:55
good morning bros!
user7912927
new cabin..boss just next to me..fuqd up :(
06:16
aww @Blake , morning bro. :)
06:27
Hey everyone, I've got a question.. I got this sql with this result i.imgur.com/MNjkbBA.png . And I would like to group on productName and then add all quantityOrdered together where the productName is the same. How would I do that? Only "group by productName" will result in the quantityOrdered to be always 30, and doing a sum(Classicmodels.orderdetails.quantityOrdered) at the beginning of the sql als wont work..
Morning
@Vulkanos .. i'm not if this query will work. It would be easier to help if you'd create a sql fiddle at sqlfiddle.com

select
sum(classicmodels.ordertails.quantityordered),
classicmodels.products.prodcutName
from
Classicmodels.orderdetails,
classicmodels.orders,
classicmodels.products
Where
classicmdoels.orderdetails.ordernumber = classicmodels.orders.orderNumber
Group by
sum(classicmodels.ordertails.quantityordered),
classicmodels.products.prodcutName
morning @sami :)
how was the weekend guys? @blake @sami
hey @ARr0w o/
hmm weekend is (friday & saturday)
and yes was good
well good to hear that. I had only sunday
lucky you that you get 2 days
It seems like I'm lucky
06:37
you are :P
but the real say No
bc I don't have a weekend
eh?
because of saturday is on?
well
from Saturday to thuresday
You will find me in office
Friday => work at home
That's the real life I have
Thanks for the answer, sadly it wont work... Ill try to create the sqlfiddle but it will take a bit x)
@sami that's so sad:(
06:45
That's the real mate
hope this is how it works?
again, I'd like to sum up all quantityOrdered where the productName is the same and group by productName
07:10
@Vulkanos

http://sqlfiddle.com/#!9/67ddc/12
i hope this is what you were looking for.
i first summed up via the calculator to check the quantity.
1952 Alpine Renault 1300 total orders of this are 382 on calculator as well
so the result for the 2nd one should be correct as well.
the weird thing is, I got that SQL aswell. but it always gives me 105210 in my local db for every single entry..
But, it is giving a right result here. Just calculated the other product name as well, it is also 382
which sql you are using?.. try copy pasting this one there.
and execute.
sec.. ill try to make the sql fiddle a bit better with other values and try again
morning
07:32
morning @AndyK
@Vulkanos alright.
@ARr0w ok, I got the issue. What I selected from my database was not actually what I wanted. I rewrote the SQL and now it does what it should do. Sometimes you just have to start from scratch :)
SELECT sum(CLASSICMODELS.orderdetails.quantityOrdered), CLASSICMODELS.products.productName
FROM CLASSICMODELS.orderdetails, CLASSICMODELS.products
where CLASSICMODELS.orderdetails.productCode = CLASSICMODELS.products.productCode
group by CLASSICMODELS.products.productName

This is what works now :)
@ARr0w o/
@Vulkanos true that and that's the exact resolved query.. copy paste, run and stay happy. :P
Yah ^-^ thanks
where is @AdiMohan?
07:40
@AndyK no idea bro.
@ARr0w how are you?
@AndyK doing great, Thanks. How about you bro? :)
@ARr0w just back from hols. less tense. Do you have any holidays in Pakistan?
that's what holidays are for to lessen the tension, stress and all.
Well, 10 to 15day leaves yearly basis in private jobs.
user7912927
07:59
weekend was so good @ARr0w
@ARr0w that's ok my friend
@Blake hey
08:14
hey guys
:D
user7912927
hey @AndyK
user7912927
hey @AdiMohan
@AdiMohan yeah!
hi @Shaneis
hey @AndyK
hey all
08:42
Morning
09:25
@CrashBandicoot \o
o/
I need some help with SQL
I'm getting Message 547 - INSERT statement conflicts with the FOREIGN KEY
I've read that, if I want to insert some data in the Child Table, there must be matching data in the Parent Table. But, I tried Inserting into the Parent Table. Same problem...
@CrashBandicoot sqlfiddle.com
Isn't there a quick way to fix it?
@CrashBandicoot I don't know your code...
is there such thing as quick fix beside?
09:40
Not really
10:28
I finally quit my god forsaken job guys :D
Why? @AdiMohan
because the people i worked with are really really reaaaaally bad
happy days ^_^
Good for you!
yep, feels really good
I haven't felt this happy in a year
Nice to know!
10:33
@AdiMohan congrats !!!!
_________
\-._.--./
 `-._.-'
    I
    I
    I
   -^-
@AndyK thanks :D feels good to be able to share this with you guys ^_^
10:56
@AdiMohan where are you going, if I'm not prying?
11:16
@AndyK well, I'm orienting myself toward Continental :D
awesome place with awesome developers and good knowledge of all the stuff i like (C# especially)
1pa
1pa
Hello guys! Can i ask something?
don't ask if you can ask, just ask :D and if anyone can help out they will
1pa
1pa
I ran a command to do a alter table to add a column but i stop before it stoped..but now i can't get acess to the table...
i'm in panic
what was the command? copy paste it here
1pa
1pa
i run a simple select command with limit 1 and keeps run
11:20
your query keeps running?
1pa
1pa
ALTER TABLE t ADD COLUMN source_info texte; -> here i made a mistake "teste" so i stopped
before it commits
but now i just run "select * from t limit 1" and my query keeps running...
what's going on with my table?
is it a big table?
1pa
1pa
yes
do you have loads of data?
1pa
1pa
No
Nothing is being inserted into the table
11:22
huh, that's odd...
normally this would happen under very specific conditions, otherwise you should be able to cancel it and that's that
1pa
1pa
do you have any ideia what's going on?
do you have the option of rolling back?
1pa
1pa
i'm noob i don't know i'm using postgresql
i stopped the command..
Anyone knows whats going on?
11:51
Hi all
1pa
1pa
hi Alex
Hey 1pa
Are you able to fetch data from other tables on the db?
1pa
1pa
yes
What's going on?
1pa
1pa
let me check
m 29870 609 0 10:38 ? 00:00:00 postgres: m db [local] ALTER TABLE waiting
is this?
user7912927
11:55
@Sami hey
Yup, I think that's the one
Hey Blake
user7912927
hey Alex
1pa
1pa
Now i have to kill it?
Hey Blake
hey @Blake
I think so
Hey Sami
1pa
1pa
11:56
What is the number? 29870 or 609?
hey @Alex , hey grand pa
user7912927
hey 1pa
user7912927
@Sami burj khalifa
I think it's the 29870
Wiki
1pa
1pa
11:57
I'm really noob at this, i'm afraid to do something wrong i just need to run "kill 29870" right?
kill what?
I'm not an expert on Postgres, so proceed with caution
1pa
1pa
the process Sami
user7912927
@Sami hows it going?
I think you'll be ok if you kill that process
But don't quote me on that!
11:59
@1pa yes
1pa
1pa
i will try keep here please one sec
Is this a test/dev environment or production?
kill 29870
user7912927
14
Q: how to nicely stop all postgres processes

mattHow do you nicely stop all postgres processes with pg_ctl (or otherwise), when you don't recall what the database directory is, nor have the PGDATA environment variable defined?

@Blake Good you say
52
Q: Heroku Postgres - terminate hung query (idle in transaction)

alanI'm using Heroku with the Crane Postgres option and I was running a query on the database from my local machine when my local machine crashed. If I run select * from pg_stat_activity one of the entries has <IDLE> in transaction in the current_query_text column. As a result, I can't drop t...

user7912927
12:01
@Sami u working as accountant now?
1pa
1pa
Worked!!!!
Thank you!!!!!
Thank you thank you!
:)
1pa
1pa
i was in panic
Yes , and tbh work everything :)
Nah, no panic
Was that production?
12:02
@1pa Great grand pa
1pa
1pa
yes
user7912927
@1pa cheers!
1pa
1pa
:D
user7912927
@Sami@Alex cheers!
Having worked with full privileges on production db, I've learned to only do those mods in dev/test, then have the changes ported to production
Then when something goes wrong, I'm not affecting production systems
Just my two cents
12:04
What ?
@Blake ???
1pa
1pa
ah oki noted, thank you very much all and you @Alex :)
You're welcome
lol
user7912927
;)
:)
@Alex :p :p :p
Someone love me :p
12:06
Love is the answer, regardless of the question
The stars in the galaxy are held together by the power of attraction/love
Nice
Work hard , Play hard
@1pa proceed with caution. Killing a process might not be the best thing to do
1pa
1pa
I already did, but can you explain me why ? @AndyK
hi @Alex, hi @Sami
heya @AndyK o/
12:09
@1pa it might messed up with your database, putting in an desired state
let's say you have Alex doing some update on the db
1pa
1pa
How can i check if that happened?
Sami is doing some inserts
1pa
1pa
but nobody have access do this db except me
if you kill everything abruptly, which transaction should the db take into account
oh ok
1pa
1pa
12:11
so everything is alright if no one have access right?
user7912927
@1pa are u dba?
Hey Andy
1pa
1pa
yes @Blake
user7912927
cool..same here ;)
1pa
1pa
But i don't have background in this field so everytime something gets wrong i have a panic attack xD
user7912927
12:13
yeah..and thats how i reached here..now everything safe! :))
@1pa You'll learn as you work on these things
1pa
1pa
ya :)
That's how we've gotten our experience... a lot of trial and error
The key is making the changes on dev/test, then on QC, and if all goes well, then on production
1pa
1pa
Ya and this is fun, but i was a biologist so this is all new
You're going from biological science to computer science
1pa
1pa
12:16
yes :)
Best way to learn: study the concepts and then apply the knowledge on a project. Then reflect on what you've accomplished and plan for the next steps. Repeat.
1pa
1pa
i think my problem is that always afraid to do something wrong
Have a development area, where you can run stuff without affecting anything
1pa
1pa
but my db have 400 gb how can i do that?
Take the structure of the database and create that on another server
Then add test data to the tables. Maybe a small sample of the production data
1pa
1pa
12:21
for example now i have to update database, and i wrote a python script to do that but i'm afraid something went wrong when i update
i don't have other server
Fetch 10% of each table's data and export to other server
That makes it tricky
Never a good idea to run queries on production
1pa
1pa
ya and now i'm afraid to do but i don't know how can i do in another way
can i select 10% of the db and make another?
I'd recommend some research into that. Not an expert on Postgres
If your research doesn't reveal any answers, then post a question to SO
1pa
1pa
you right thank you Alex :)
Because you really need a dev/test area
You're welcome, 1pa
12:25
hya
anyone good with data structures in sql?
You mean arrays and such on SQL Server?
sort of
are they a common problem?
in any case, consider the following table structure: imgur.com/a/TuXiE
Well, sometimes you need to pass a string array to a sproc
with the following test data: paste.ofcode.org/32GDnnv85xE2Jbh8LyV3qai
only the Rejection table and the Key table are relevant for now
I want to have a query that looks like this:paste.ofcode.org/Q2YCM9ewtAeQUPN3MnLMwe
except that that does not work in sql
Which db?
12:32
MySql
sorry
MsSql
this is the data structure I want to achieve
this is the closest I can think of but it ofcourse doesnt work properly: paste.ofcode.org/SxzYgU5aspf5GbJEdQ9YAq
Just throwing something out there...
select * from Rejection r join Key k on r.id = Key.RejectionId
	where r.key like '%key1%' and r.value = 'value1' ....
yes... but those dots is the problematic part
I cant do "AND r.key = 'key2' and r.value = 'value2'" because that would never match considering the first part of the "where" statement
and I cant do "OR r.key = 'key2' and r.value = 'value2'" because then it matches on "any of the constraints" while it should only match on "all of the constraints"
(on a side note, considering how easy it is on a non-relational database paste.ofcode.org/fRCPqD6MrP4UQAXtfwcgTi , this should really be easy to do)
@Alex ?
12:49
Hmm. If it matches on "all of the constraints", then that's an AND
not true, because it uses several rows to match on
You need to play with the WHERE to see what provides you with what you need
i want like "get the Rejections where they have key rows with key 'key1' and value 'value1'"
im not sure it is possible
What's the data that it should produce?
What might help is to create a SQL Fiddle for this
that is the test data
and that is the query in its current (incorrect) state
12:56
So what should the SELECT produce when it reads that test data? That's where a SQL Fiddle can help, because we can modify it too
sql fiddle says invalid syntax
I want to select the insertiondate, expirationdate, data and keys paired to the Rejection table
Did you select the correct db from the dropdown?
thats it
in simple terms, I want to get all the Rejection.Id values
from that, I can do normal select queries to retrieve the data
which really appear to be not very efficient
if you think about having to search through the database, then return the ids, then search again for the data bound to those ids
Here's a simple join: sqlfiddle.com/#!6/399a5/6
13:04
ID Children
1 [2,3,4]
2 [5,6]
3
4
5 [7]

I'm using PostgreSQL, trying to get all related children and parents. I know that there are plenty of recursive query examples, but they all have parent IDs, or just single children.

I imagine I can write a recursive query to find the root parent, and after that, another query to find all children, but I'm not sure if this is possible with arrays. Should I keep going down this path, or am I thinking about this wrong?
that query should return 1 and 2
@Alex im currently feeling like i have more power if I just put json code inside a column in the Rejection table...
@Microsoft do you know when you suck? when you have more power over the data if the data is serialized
:D
 
1 hour later…
14:35
^ If you choose to continue
@CrashBandicoot lol
14:50
how many steps does it take to become sorta good?
we can learn a lot from Microsoft in that perspective
Depends on how willing you are to succeed.
Many steps. And we will fall. But it's part of learning
2
they have been taking those steps for years
And the learning never ends
If it does, we're in trouble
nah
if it does, we are in utopia
14:52
And never judge yourself by someone else. The only person you have to best is who you were yesterday
yesterday, i was asleep
i think i made a superior improvement
Let each morn be better than its eve and each morrow richer than its yesterday.
:)
searches google for abbr.com
see ya folks
@Alex I concur
See ya, Andy
15:06
@AndyK Bye!
@Alex @CrashBandicoot how do you call a database engine that is similar to how sql works, but instead of storing the primary keys in linked tables, you store the row reference of the other table?
and having arrays of those row references
@Wietlol No idea.
i thought about it being a non-relational database, but that isnt really true
it follows most of the relational database rules
ah, Hierarchical database model probably would fit
15:39
Ah, okay

« first day (1900 days earlier)      last day (2418 days later) »