« first day (2349 days earlier)      last day (1969 days later) » 
00:00 - 13:0013:00 - 18:00

00:23
Today start with bad thing.. Failed to apply for work..
 
5 hours later…
05:43
hey guys
running around
howdy?
06:13
Morning!
Morning.. Not good..
Why?
No, don't get it this way @dwir182
Yes?
we don't know what is the best for us, sometimes we feel like something is not for us, but it's good
cause we dont know what will happen next
Mybe it's good for you to fail, cause another (best) job waiting for you
Who knows?
Yes.. Agree.. But my parents really want me to get that job.. I just don't feel good turned them down..
06:22
Yeah I'm sorry, but your parents can't change the fact and they did not knows the future
imaging you get this job
and you die because of it
then they whish you fail
No one knows what is best for you
Really extreme sample.. Lol..
@Sami That also means it could be the best :P
I don't wanna die.. Please..
We all die at some point :D
I mean not now.. Lol
But no one knows..
lol
06:27
Sometimes, it's best for us to fail, we just don't know and get angry and feels bad anyway :)
06:38
May you hate something that is good for you, and may you love something which is evil to you
Ah what you are talking about sin right? people loves it even they know that's bad for them.. :D
@Shree Welcome to SQL room :)
Thanks :)
Is it because this? haha
@ZaynulAbadinTuhin ah.. Haha.. Welcome..
Yap :P Queen caught R/A comment
06:44
@dwir182 Not just sins, it's about everything including sins
I am not promoting this room.. :P
I dont know DB room exist otherwise I already in :)
@Sami okay okay.. Lol..
actually sql.. But if talk database we still know.. :D
@Shree Yeah DBs room including the blue one -me- :D
This room many sql server people
06:48
Yap i also work with SQL and glad to find this room.
And book marked :)
;)
Haha.. Glad you bookmark it.. I am new member here too..
@dwir182 Me too :p
Should i share the older message to show you are the old person? @Sami? :P
:D
06:51
11:51 AM. 9 minutes to Noon, so Good Morning guys and @dwir182 :D
Afternoon @ARr0w
>_>
You traitor my friend
@ARr0w Morning dude
Run query to find message from Sami
06:52
@War Wake up bb we have guests :D
select chatsami from room where datemessage = '2015-06-07' and sami = 'old person'
that will hit for sure
:P
@dwir182 Wow... now that's ^ wrong
No.. The parsing are good and the engine find you in instant
2016-09-12 My first Msg in this room, I think @Shaneis was sir then :)
07:07
hello can i ask regarding SQL injection?
I guess you have so much free time @Sami
okay
@guradio if we could help we will gladly help you.. :)
@guradio Ask everything related to SQL and @dwir182 will be glad to answer
normally when you select in database you need a keyword. So when selecting you just append the keyword and do a select. For wild card select query I am wondering if adding * directly in the input search field is safe from sql injection. Example user needs to type into select box keyword then click search button
@Sami glad to hear that. @dwir182 Hope I have expressed my question properly please clarify if not clear enough
07:12
@dwir182 Make us proud^ :D
@Sami wt h.. ._.
@Sami he will for sure :)
i am sorry i still don't get it
do you mean adding * in select statement?
no directly in the input search in the web browser itself.
@dwir182 the user will try keyword to search wildcard for the keyword
* keyword * sorry I didnt notice * is being converted @dwir182
@guradio so if i am reading right you want to do select * from table where column like 'variable%'?
07:17
no @WhatsThePoint it will be select * from table where column like 'variable' because variable will already look like * keyword * . That is why im wondering if it is a safe practice
the * is included in the variable already
well * aren't for wildcard searches in sql
Concatinating the SQL in self is not good practice
if you adding * still will return the value right? actually sql injection not about adding that.. But make it parameterized
But i am wonder.. Is it public? your web?
yes im still getting the correct/expected result @dwir182 im just worried that it might be a disaster when it comes to sql injection especially if user has knowledge in programming they know that searching for * keyword * means wild card search
i really can't understand what you trying to ask man
07:21
it is for our company so public in a way .
@Veljko89 just picture out like this when you search in google you add * before and after what you try to search and press enter
ok, and
@Andrew help here man..
now I want to make sure that it is not vulnerable in sql injection
because Im not really sure if it is safe or not.
sample SELECT * FROM users WHERE name = '' OR '1'='1';
that's sql injection
so add * this to where?
@WhatsThePoint doing patrol?
07:24
Morning
@dwir182 im always on patrol
@dwir182 when selecting query will be like this SELECT * FROM users WHERE name = 'keyword' right? to do wild card you will go SELECT * FROM users WHERE name = '%keyword%' right? in my case I will require user to have * in the search field like when you search for USA you need to type in search field * USA * then click search
@Andrew afternoon.. 02:25 P.M
@WhatsThePoint i hope i don't get arrest by you.. :D
Still not vulnerable..
I mean i am requiring users to type in special characters in the search field which I think is a start for sql injection
I am sorry.. I think your concept about sql injection is different.. What do you think about sql injection?
07:28
when users can add additional query most notable UNION in addition to the current query so that they can see other data from your database
@dwir182 Am i mistaken? Then im worried for nothing?
can you please provide your code, as it stands we are insure of your question so the code will help us provide an answer
SQL injection is a code injection technique, used to attack data-driven applications, in which nefarious SQL statements are inserted into an entry field for execution
That's wikipedia
It means it is inject your sql not the value
If you use proper parameters instead of string concatenation to create your query, you are unlikely to be open to sql injection
handling them use parameterize value
sql injection always requires some form of string concatenation / creation of the query
07:32
i mean like if user can do * keyword * ' UNION ..... because there is * i thought that it will be start if all is safe then thank you everyone for your time in looking into my question
I will be asking more question Im hoping you guys will still answer them in the future thank you again
Do you got the answer?
Just ask..
:)
yes @dwir182 thank you very much I think my problem is my understading with sql injection sometimes I just dont understand things and associate other things. ENglish isnt my native tongue so I have problem sometimes understanding especially if the words a seldom used thanks again mate
Me too.. But see the quote @Andrew..
No apology needed, I barely speak any other language, I have no requirement that everyone else can speak English
As long as we can understand each other then is fine.. :)
why do i bother? stackoverflow.com/a/52894723/7147233 OP said my answer worked, doesn't mark it as accepted
Lol..
07:40
il upvote for you mate :) it wil help others in time
Take my upvote
its why i hardly answer anymore
Unsung hero my friend..
i prefer to just hang in here and answer questions in here
07:45
unsung hero is gold aim for it :) its not a badge only a few people have but there are alot of high reputation people already :)
@Veljko89 answer it
Hello! I have 3 tables: Persons, Laptops, Phones. Each person owns a number of laptops and phones. Now I want to output a table showing for each person how many laptops and phones they own. Example: John, 2, 1; Anna, 3, 2; etc. My unsuccessful attempt: SELECT COUNT(*) FROM Laptops, Phones WHERE PersonId IN (SELECT PersonId FROM Persons). I guess I need some more advanced SQL concept here, would you mind telling me what kind of query could solve my problem? Thanks!
can you create fiddle with sample data?
i think your query is simple
i think laptop count is different than phone count and should have a different variable
Yes.. He use old join too.. That's not good.. Read here Bad Habit: using old style joins
07:51
i think this should work
SELECT   personID,
	     count(la.laptopID),
	     count(ph.phoneID)
FROM     persons pe
JOIN     laptops la on la.personID = pe.personID
JOIN     phones  ph on ph.personID = p.personID
group by personID
You can't get upvote here man.. :D
i cant upvote comment too. sad
I would LEFT JOIN those incase someone doesn't own a phone or laptop.
Thanks for the answers! I am testing all of your suggestions in SQL Fiddle right now :-)
ah yeah true, @NicolasRaoul change my joins to left joins
07:54
you also would want count(distinct la.laptopid) - since the double join will cartesian (and a distinct count on the pa.phoneid)
the boss came..
e.g. 2 laptops, 2 phones will give you 4 rows, a count of 4 on both, when you wanted 2 and 2 - so you need to count the distinct IDs
what a monster in sql :) please dont kick me in this room
its a group effort :D
He is in different level..
07:57
Now I know ways to select only distinct in my joins. One question what if you want to to select * distinct how would it look?
not only count but all data but distinct from each?
select distinct *
but in reality you should avoid * more often than not and choose the columns you need
when you are going to query i think first you need what do you want.. distinct for all column.. why must that do?
Not including recent suggestions: sqlfiddle.com/#!9/117ad/1
sqlfiddle very slow these days
08:01
i thought its just me but im loading that url very slow
why sqlfiddle
dbfiddle please
lol
so i formatted this guys code and he just rolled it back stackoverflow.com/q/52943247/7147233
@dwir182 - 9 phones is not right, you havn't got the distinct count in there I mentioned and thats what happens
i forgot.. Haha
why your fiddle not work? @Andrew
just loading
08:03
check this with distinct
Thats sql-fiddle for you
but I get the correct counts of 2/2 and 3/3, not 4/4 and 9/9
@WhatsThePoint lol.. Edit again.. +2 infinite
its giving the correct one. 2 and 3
which is the cartesian effect
without distince its giving 4 and 9
08:04
@dwir182 you dont get rep for edits after 2k
Oh.. haha
Wonderful! Thanks @Andrew it works as intended, I tried adding more persons with various numbers of laptops and phones. I will study the query and experiment by myself :-)
Ive learned something today thanks @Andrew by the way is there a sign that you are getting the cartesian effect ? or you need to determine it manually?
ah done?
that's boss for you.. ;)
@guradio you just need do know your data and expected results
08:07
@guradio that's what call analytics..
I see.. Then its hard to determine expecially if youre not the one who created the database
@guradio - any join of 1 table to 2 others where it is a 1 to many will cause cartesian effects
@Andrew noted on that one
e.g. a ->b and a->c - can cartesian, while a->b and b->c won't in a sense
@guradio - I am rarely the one who created the database, learning / understanding the data model implemented is usually one of the first things you have to do to be effective on a system
why @Andrew always make good quote? do you want publish some book?
08:11
hahaha question not related to SQL how can i go to this room fast? :)
i already added this room as favorite
Do you know @guradio? i forgot the day but @Andrew and @War talk about space.. How can that be related to sql?
They are dangerous..
hahahahahaha well i could bookmark but im not using my PC right now is there a way or i need to just search sql room? there might be other rooms Im afraid i need to check one by one :)
@dwir182 one day me and @AndyK talked about his roof falling down
don't worry type sql for search room and it will show
@WhatsThePoint really far away man..
@dwir182 there is way to many questions like that ... its probably duplicate question
08:18
@Veljko89 just answer it..
I will upvote
is it the one tagged with android? some voted to close it hahaha
Haha..
Somebody answer it.. For rep sake..
hehe you take rep :D
im voting to close it. good lord @dwir182 we are just neighbors :) im from sea too
08:22
Ah.. @guradio haha..
Nice meet in asian games.. :D
heung min son had a great asian games this year
@dwir182 hahahahah I hope we do good
@guradio i hope.. haha..
@WhatsThePoint who is that?
okay.. who upvote?
._.
me why dont be mad its correct anyway
not mad..
08:26
:)
just curious..
War
War
@dwir182 we were querying the universe
totally related
i give up @War
War
War
lol
Blue ball morning
08:33
Really funny veljko answer got upvote and downvote drastically..
@War Unclear
War
War
it wasn't me
i deny all knowledge
@War Cast vote and back to your corner, I'll ping you if needed :)
@dwir182 south korean footballer
Aaaah now it's closed
08:37
we won we closed it :)
Won nothing btw, it's unclear and for that it closed :)
wrong word.. succeeded?
Mybe
@dwir182 Still 2 points, then I can approve your edits
I'll get it soon
@WhatsThePoint i am prefer badminton than football.. But when world cup.. different story.. :D
@Sami yes?
i don't get it
08:47
@Sami you voted to close?
(Y)
I cant understand the problem
@guradio what rdbms you are using?
Anyway, closed
Deleted right?
08:49
Yup
Haha.. The question like that will never get a long life..
Yeah, as some of yours @dwir182
-3
Q: Select Sqlite Query based condition

BasiI have a checkbox and recyclerview. I have to update list related to recyclerview on checkbox change if checkbox ticked state Select Query like SELECT * FROM tbl_code WHERE isFavourite = 1 else unticked state Select Query like SELECT * FROM tbl_code

this person change again the requirement
@Sami i hope you long live.. :D
hi all
I have a question I have a db and my column type is datetime
yes and?
08:52
2017-01-01 03:01:06.000 it include this value but When I try to select
@DarthSucuk First, which rdbms
what db you are using? postgre?
is that timestamp?
SELECT date
FROM x
WHERE date LIKE '%2017-01%'
order by date
it cant get any value
but when I try

SELECT date
FROM x
WHERE date LIKE '%2017%'
order by date
it gets values
what db you are using?
08:54
mysql? postgre? sql server? etc
@Sami please do his favour..
:D
microsoft sql server management studio
datepart function
@dwir182???
Morn' all
76
Q: SQL Server datetime LIKE select?

Paisalin MySQL select * from record where register_date like '2009-10-10%' What is the syntax in SQL Server? Thank you.

Afternoon @Shaneis
08:57
S'up @dwir182
Coffee morning @Shaneis
Soup? i am not hungry..
coffee morning @Sami :D
"S'up" = "What's up?"
Nah, whisky for me @Shaneis :D
@Sami Yes Yes :D
08:59
hahahahahahahaha go tequila and beer its really good
@guradio Desperado?
@DarthSucuk Why don't you use another way? Are you storing DATETIME as String?
I dont know what its called just saw it in thor 1 they call it boiler maker @Shaneis
CIAO guys tomorrow is another day
@guradio "boiler maker"? - that sounds really inticing </sarcasm>
cya @guradio
0/
09:01
I know.. Just pretend stupid..
Nope.. I am still stupid..
:D
@Shaneis cooffffeeee maaaaan! S'up man!
"Shaneis" -> "Shane is Coffee man"
@ARr0w Did you remember what I told you?
They always earn more than you even you do better
I get a dv for the right answer if you understand what OP want, then you get a dv
09:21
Great work @Sami
Nice answer in that..
@dwir182 Thanks, I think you edit a tag before and your suggested edits was pending no?
Done.. It's already accepted..
Ok then ;)
@Sami i remembered that you asked for a min. What is it bro? link me the message. Sorry i missed it
09:28
need to sort packing out this week
09:41
Is this valid question for SO. Closed or ........? Tagged -> sql server
https://stackoverflow.com/questions/32573256/ssrs-bids-2008-unable-to-load-the-credentials-type-is-not-in-the-serialization
[NATO]
its quite an old question
question is valid
I think I would just leave it - it attracted 4 upvotes in it's time, so clearly others encounter this problem
Yap old i mention NATO -> New answer to old question so detected
Ok but up vote don't ensure that it's fit for the site. So many up voted question are closed as off topic.
Like I said the question is valid
09:54
Humm ok . Just leave it and move on :)
yes
flag that new answer as NAA though
Already did :P
@ARr0w Sorry, was getting coffee
@Sami so...yes. I guess I am
@Shaneis haha :P
Hi all. I somehow locked myself out of my postgresql db. I was using pgadmin4 and changed the password of the default user postgre to something different but now I can't use anything and always get the error invalid password, but it never asks me to actually enter a password.
10:10
What user do you use to log in? Postgres?
Try psql command
I can get in with the cmd but not using pgadmin4
Use other user and alter your user passowrd..
it has somehow still the old pw and i can't figure out how to clear it
Postgre version?
10?
Ok got it. I had to disconnect from the server. And not under servers in general but under the specific server. Super weird that it doesn't automatically kick you off when you try to do something with a wrong password
10:13
Maybe related with cache..
I heard postgre have some bug in cache.. But i forgot read in where..
i don't think it was postgre itself it was pgadmin being weird
would this help?
https://stackoverflow.com/questions/10845998/i-forgot-the-password-i-entered-during-postgres-installation
I am still using pg3..
Lol..
10:44
Can someone explain how colaece do? Example select coalesce(value, 1, 2) from table
When check that value if not null will return value if null then return 1
How to go to arg_2?
What condition?
it doesnt work like that. Its not a true false
I am not say true false..
coalesce is not a decode (oracle)
coalesce(1, 2) = 1
coalesce(null, 1) = 1
if you want that kind of logic its a case statement
10:46
takes first non null valuable
So coalesce just take first not null valuable?
correct
Okay.. Thanks.. Really stuck in my head..
;)
Is it possible to escape column names in postgresql?
I tried: "INSERT INTO data ('date', 'on') VALUES %s" but I get invalid syntax error
I'm using psycopg2(what an ugly name for a module)
I tried this because I got a syntax error on the word on, after escaping i get the syntax error on date
11:04
Error in 'on' column?
Why naming column like that?
don't ask me, it's a legacy system and the previous guy gave me a csv with column on. no idea what it should be
but i got it. turning the quoting around makes it work
'INSERT INTO data ("date", "on") VALUES %s'
like this
weird
Not really
Double quote for column or table name
Single quote for string
coming from python where str can be declared with either " or ' it is
Yes it can.. But usually people prefer single quote..
For string
Depends on the field. I experienced the opposite.
11:21
Is it a feature or a bug that the primary key counter get's incremented even when no value was added into the db because the code never reached conn.commit()
I have now one entry in a table with the id 15, I thought it should be one
There are no bug like that as far as i know..
So this is normal? I thought without commit nothing get's changed in the db...
I am sorry.. I don't get it..
It's normal
Id's are taken before commit, whether they are used or not, the ID is gone
Oh ok. Weird, any idea why this is so? Implementation detail or actual thought behind this behaviour?
Just looks ugly to have my rows start at 15 :P
11:35
I would be incredibly complex to put a number back into the pool on rollback for re-use
opposed to a single auto-incrementing number - these ID's should have no meaning assigned to them, they are arbitrary
Yeah I know it doesn't matter. It's one just not pretty and two this means two dbs won't be in the same state even though they could have gone through the same process... this points does sound more alarming
why would it be complex? Just have a counter and update it only after commit?
12:33
because 2 processes running at once then would get the same number
since you only increased it after the commit
to increase it before the commit then requires you have a 'pool' of unused numbers to give out - which will be slower to operate
12:53
Oh that makes sense. Yeah for a layperson hard things might look easy and opposite :P
00:00 - 13:0013:00 - 18:00

« first day (2349 days earlier)      last day (1969 days later) »