« first day (1907 days earlier)      last day (2411 days later) » 

user7912927
05:25
@Sami im here
user7912927
;)
05:38
@Walker ya
05:58
morning guys
06:47
@Blake Yeah
Morning everyone
hey dude
hmmm...
I'll kill him
 
1 hour later…
08:14
Morning guys
brb coffee time!
08:30
sure Shaneis
and hello!
1pa
1pa
i'm in panic help me please
sudo pkill -u my_user_name
i ran this command
and now i can't access my db
help me please
user7912927
why u ran that command?
1pa
1pa
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?

to stop process
but i made the mistake and instated od postgres i put my user_name
please
user7912927
sorry man..i dont know abt postgres,,,! there are ppl here who can help u..relax :)
1pa
1pa
anyone?
@Shaneis
08:36
hey @ARr0w
@1pa why don't you just log in again?
1pa
1pa
doesn't work
Log in with a different account?
1pa
1pa
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
1pa, login using administrator?
which is 'sa' in sql serer
1pa
1pa
i don't know
i don't know about postgres
08:37
google the super administrator
in postgres
Wassup @Shaneis
just working away, yourself?
1pa
1pa
i don't understand
when i try to ran something
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
this appear
@1pa is Postgres still there?
@Shaneis, working away. Same dude
@ARr0w Sweet!
08:55
morning
morning andy!!
hey @AndyK
we all got caught up in our work huh? :P
@1pa you'd better be careful when trying to stop processes.
think of yourself as sysadmin before doing everything. If you have have a team of 10 people on which you have impact, would you do what you are currently doing e.g killing the processes on the fly and then sending us a message in the chat room?
@ARr0w nope for me, I'm on hols and enjoying it ;p
@AndyK yeah you have been on hols for quiet long now. I am falling in love with the organization that has given you such a vacation :P
09:01
@ARr0w only a week 2 weeks ago and another week this week and no more holidays for this year...
that's almost a whole month
and that is really nice and long vacation
@ARr0w but big pressure
anyway, going for my breakfast. see you later
enjoy the breakfast buddy
and don't take pressure man
work's gonna be on its place and it will get done. I just learned to take no pressure at all with work even if the priority level becomes 10 out of 10
1pa
1pa
09:21
sorry my had to go
but i still can't acess
please
@Shaneis @ARr0w
hello
i have a question
how i can use OR in CASE WHEN statement
as
select * from Document
where
CASE WHEN @option = 1 THEN isLastVersion=1
ELSE isLastVersion=1 or isLastVersion=0 END
1pa
1pa
anyone?
please i'm in panic
@1pa Ask a Q in SO
afraid none of us here know Postgres
@IbrahimAlsurkhi : that makes no real sense...why do you want IsLastVer...=1 or =0?
09:40
@IbrahimAlsurkhi is IsLastVersion empty or is it already filled?
already filled
would this do for you?
CASE WHEN @option = 1 THEN IsLastVersion = 1
ELSE IsLastVersion END
it is work fine
thank you
Your efforts are appreciated for me
glad it worked for you @IbrahimAlsurkhi
but if you know how i can use conditions with case when
as
select * from document where case when 1=1 then isLastVersion=1 else isLastVersion=0 end
it is possible ?
09:48
Why not just re-write that as SELECT * FROM document WHERE isLastVersion IN (1, 0)
i need only 1 in some case and only 0 in some case
SELECT * FROM document WHERE isLastVersion = (CASE WHEN @option =1 THEN 1 ELSE 0 END)
Like that?
some time i need but the
SELECT * FROM document WHERE isLastVersion = (CASE WHEN @option =1 THEN "condition here" ELSE "condition here" END)
it is possible
That should be possibe as long as the "condition here" is a value of isLastVersion
Heyyo
09:59
but i try statement like this
it is not working
SELECT * FROM document WHERE isLastVersion = (CASE WHEN 1 =1 THEN 1 ELSE 0 or 1 END)

Please pay attention to 0 or 1
my main question how to put 0 or 1 in this statment
Got a real quick definition question
When using SQL's *not exists()* , would that be the same as something like this in any other language?

if(item == null)
Or should I say, am I wrong in thinking that it checks whether something does not exist in a certain query?
@IbrahimAlsurkhi 1 is always going to be equal to 1... so you basically just said WHERE isLastVersion = 1
@Xariez With exceptions, yes.
Alright! Thanks!
@Xariez if you have a column that is null though, it would be better to use IS NULL though
user7538827
10:36
Hello
user7538827
I have an error on this sql server query: select
convert(varchar(5), Cast(convert(varchar(5), (OreFine - OreInizio), 108) as datetime) - CAST(REPLACE(Pausa, '.', ':') as datetime), 108) as TotaleOre
from PreventiviCI.dbo.RisorseUmane can you help me?
user7538827
the value of data , oreinizio and orefine is datetime
what's the error?
Also what version of SQL Server are you running?
user7538827
Error is this: Msg 242, Level 16, State 3, Line 1
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value. my dbms is sql server 2012
user7538827
@Shaneis
10:42
and the Pausa column? What data type is that?
user7538827
Pausa is column of type money
Wait so you want the result to be "<date> - <money>"?
I would say that's why you're getting an conversion error...
user7538827
yes
select
convert(varchar(5), Cast(convert(varchar(5), (OreFine - OreInizio), 108) as datetime) + ' - ' + CAST(REPLACE(Pausa, '.', ':') as datetime), 108) as TotaleOre
from PreventiviCI.dbo.RisorseUmane
try that first, we'll try to change as little as possible
user7538827
It does not always work the same mistake
10:54
does this bit work?
select
convert(varchar(5), Cast(convert(varchar(5), (OreFine - OreInizio), 108) as datetime), 108) as TotaleOre
from PreventiviCI.dbo.RisorseUmane
user7538827
It works, thank you very much
Hey, I would like to group some selling details by month and also display months where I didnt sell anything. I already prepared a sqlFiddle for my question: http://sqlfiddle.com/#!9/2907a/1

For example - february is not displayed in the query response, but I would like to display null or 0 for february.

Another question, which is not as important, is could I display the name of the month grouped intead of the first found date? So it would not show "2003-01-02" but "January 2003" ?
user7538827
@Shaneis thank you
@RiccardoPirani then your problem is the with storing time as money
if you don't have to do that, I would say don't :)
@Vulkanos what db are you using?
mysql workbench
11:05
right it could be different for MySQL but
you can use DATENAME(MONTH, orders.orderdate) to get the month
just google what MYSQL's syntax is
for the nulls, I'd add a temp table with the months and just LEFT JOIN them
@Shaneis Im not very experienced with sql, could you how me how?
@Vulkanos sure , if you tell me if MySQL has a DATENAME() function (try google) :)
@Shaneis thanks! Yeh, it has a Date_format() function. Where you can do Date_format(date, '%M') to show the month name
11:23
@Shaneis I managed to get the sql so that it shows month names and the year next to it. How do I display months that are null / 0? sqlfiddle.com/#!9/2907a/3
11:46
@Blake me too :)
Bye guys, cya
user7912927
bye @Sami
can you do a LEFT JOIN ( VALUES ('January 2003'),('February 2003),...)?
sorry was out to lunch
Hi all
user7912927
hey @Alex
Hey Blake
11:58
I managed to left join on a month table, but it still wont show the empty months. I must do something wrong :/ sqlfiddle.com/#!9/dcd7d3/1
@Shaneis no, I cant, it says syntax error
can someone help with this issue? I would like to display all months for mDate. Not only months with values, also thouse where I didnt sell any goods. March is not included in the example, but I would like to show March 0 or null something like that. sqlfiddle.com/#!9/9d7df2/1
12:39
Hello
I have a quick question regarding query execution order, any one interested?
In a complex query where two tables are joined, when will the where clause be executed?
I have this query:

SELECT *
FROM lender_rules rul
INNER JOIN loan_requests req
ON (rul.age1 > req.age OR rul.age2 < req.age)
OR (rul.citizenship != req.citizenship)
OR (rul.income1 > req.monthly_earning OR rul.income2 < req.monthly_earning)
OR (rul.employment_status != req.employment_status)
OR (rul.employment_length != req.employment_length)
OR (rul.property_type != req.own_property)
OR (rul.allow_bankrupt != req.bankrupt)
WHERE rul.lender_id = ?
AND req.date_requested >= DATE(NOW() - INTERVAL 7 DAY )
each table: lender_rules and loan_requests may contain a lot of records and I am thinking of using two queries and then matching them using a for loop. I think it will reduce the two sets by a huge margin since I will be querying rules for only 1 user and getting all requests for last 7 days.
I wanted to know whether WHERE clause will do it before or after joining the table, for performance.
By the way, its for MySQL
Order of ops:
1. FROM
2. ON
3. OUTER
4. WHERE
5. GROUP BY
6. CUBE | ROLLUP
7. HAVING
8. SELECT
9. DISTINCT
10 ORDER BY
11. TOP
It appears WHERE happens after the JOIN
That means it will return a reduced set instead of working on a reduced set.
12:47
I think using two queries to fetch two sets and then matching them using a for loop would be much efficient
Maybe. Try both. JOINs should be pretty fast
but it will join all records and there are multiple columns.
I should use profiler
@Vulkanos take a look at that, see if you can get that to work for you sqlfiddle.com/#!9/d7225d/6
@Waleed Perfect tool for what you're trying to do
13:20
@Waleed apnay sheher ka dosra banda yahan dekh kr khushi howi :D pehla main hon :P
hi @alex
Hi ARr0w
@alex you join when i take off. What's your timezone is? :o mine is +5.
6:22 PM evening
13:39
Hey ARr0w, it's U.S. Eastern time here, so when I come in, it's already 5pm or later in your area
It's 9:39 right now
cool its early morning at your place
 
1 hour later…
15:08
Hello. I'm a little new to the more advanced functions of SQL (you know, stuff beyond your basic "SELECT...FROM...WHERE" stuff). I had a quick question- suppose my sql script creates another script; how does the created script run?
You can see my comment to this answer for context: stackoverflow.com/a/4394/3856609
15:54
@ARr0w Hello xD
Why do I have to always write Mysql when I just want to search for SQL syntax ;_; ?
@Waleed Because there are many flavors of SQL: T-SQL, PL-SQL, etc.
SQL Server, Oracle SQL, MySQL, Postgres,...
The simple queries are common among them. Then the more advanced stuff, their flavor of SQL diverges

« first day (1907 days earlier)      last day (2411 days later) »