« first day (2377 days earlier)      last day (1941 days later) » 

7:00 AM
Hello
Please suggest me the function query to convert epoch timestamp to yy-mm-dd format
 
7:19 AM
Guys please help
 
Morning!
 
I have a value 1513708200000 as date
Can I convert to value to date format
?
@Sami
 
morning guys
what is the date of 1513708200000
 
@BasilPaul number of seconds since start i assume, so you can always rebuild on that
 
The value is December 20, 2017
I have checked using epoch converter
Do we have a function in SQL which would convert the epoch values to date format that is (yy-mm-dd) format
 
7:30 AM
EPOC time is the number of seconds since 1970 Jan 1.... so use:

select dateadd( SECOND, 1354320000, '1970-1-1' )
select dateadd( SECOND, 1513708200000, '1970-1-1' ) .. in your case
 
Where did you get 1970-1-1 value from?
 
Google told me
 
morning
 
morning
 
good after noon
 
7:45 AM
hehe
how are you @arrow? Work keeping you busy?
 
7:58 AM
@BasilPaul TimeStamp?
 
@Zulatin new manager.
@Zulatin team shifted.
@Zulatin you tell?
 
lol
@BasilPaul
SELECT
    YourValue,
    CONVERT(DATETIME,
            STUFF(STUFF(STUFF(
                              T.YourValue, 13, 0, ':'
                             ), 11, 0, ':'
                       ), 9, 0, ' '
                 )
            ) ASDate
FROM (
       SELECT '20180925151849'
     ) T(YourValue);
Is that^ what you want?
Or as @Veljko89 show you too
@WhatsThePoint :p
 
8:13 AM
morning
 
Hey @Tomm morning
 
o/
 
morning
 
@WhatsThePoint Any posts to flag them?
 
8:28 AM
no flags for me yet today
 
:(
 
dont worry though, i will
 
@WhatsThePoint VLQ
enjoy :)
 
thanks :)
 
@MadhurBhaiya 0/
 
8:31 AM
hey guys \o
back to SO after a day's break :)
 
That's good, have a break time to time
 
ya
felt good and I still generate rep points 100 something yesterday even though i was not active :D
 
While you was on a break, you leave me here with @dwir182
 
he always say "Go to sleep"
@MadhurBhaiya but I can't leave those, and can't leave him alone neither :D
@WhatsThePoint NAA :)
 
8:37 AM
what does transalate function do in SQL server ?
 
ok advanced Replace function
and alternative to regex_repalce
replace*
 
9:16 AM
Hi
i need help to get data from mysql...
 
oki
helps
 
@MadhurBhaiya ^^^^^
 
it would be usefull if you asked a more specific question @km8295
@km8295i am not going to join a private room with you, you can just ask it in the designated chat
 
awww, maybe it would get hot and steamy @Tomm. Don't pass on an opportunity you might regret :D
 
lmao
 
9:22 AM
:D
 
You want take data
?
Select * from table
 
dbfiddle.uk - construct the problem
makes life a lot easier
 
I want customers who are near to the last delivery_date
 
what do you define as near
 
9:25 AM
@Zulatin @Tomm loves it hot and steamy ;)
 
@WhatsThePoint hahahahaha
@km8295 if you make a fiddle i will give mysql a shot :p
 
@Zulatin LOL
 
@Sami i usually only work in sql server :P
 
:D
Can't understand that one here -stackoverflow.com/q/53389031/6426692
"Hibernate is an object-relational mapping (ORM) library for the Java language" Ugh
 
@Sami sql purist.. :D
Ugh
 
9:34 AM
@Sami too broad / unclear :P
@km8295 post a question. Please go through this link once: Why should I provide an MCVE for what seems to me to be a very simple SQL query?. Follow the guidelines there. Help us if you want help :)
 
Hibernate (like other ORMs) is a recipe for not really knowing what queries are being issued to your database. It also encourages implicitly that java classes which represent your domain model have a one to one mapping with database tables, which really they shouldn't.
 
If about performance.. There are no difference right? Between pure and orm?
 
what do you mean by 'pure' ?
writing actual SQL queries?
 
@dwir182 ORM has their overhead. For simple queries, performance difference is negligble
for programming in OOPS, ORM is good for most general purposes
 
Even simple objects in an ORM can over-select child collections to fully hydrate their data model - even if that is not the data you need
 
9:40 AM
Yes plain sql i mean..
 
when it comes to OLAP (reporting), ORM gets limited. At that time, raw queries help to get massive reporting data, in most optimized manner
 
On complex / enterprise systems, ORMs will be something you regret using
for simple stuff, sure, but if it's simple - then its barely going to pay the bills.
 
Yes.. I am really agree if complex data facing orm are not best you bet..
 
More often then not when I see ORM usage, the physical DB model and the code Model are a 1:1 mapping
which they really shouldn't be - if you follow Domain Driven Design and Aggregates
 
we use a mix of Doctrine and Raw queries. For transactional activities, Doctrine gets the job done, and code also remains in object oriented manner; which most programmers like. We have to understand one thing that not all programmers like formulating SQL queries (or understand relational algebra). ORM is a nice abstraction for them, and they can continue to treat relational data as objects
 
9:44 AM
Performance tuning ORMs is also a fun job, enjoy that one.
 
Most of the websites require basic features like add/editing/displaying a list. Those things are done in ORM in a straightforward manner. We dont need to write basic SELECT, INSERT, UPDATE, DELETE queries for every table. For reporting requirements, one can always shift to raw SQL queries, and employ your SQL-fu / Ninja techniques :D
 
I prefer plain sql rather than orm.. :D
-3
Q: MySQL display table in csv format

Yannic DI want to display my database table in csv format without creating a csv file. (Just in my console) Thanks Yannic.

Haha..
 
:D
 
10:00 AM
@Madur - its more complex that that, just thinking in terms of CRUD operations is a bad idea
Let's say you have an Order object, and an Order Item object - do you have CRUD on the order item object?
it's allowed to be created without an order existing? do you rely on the FK constraint stopping you from doing that?
 
-1
Q: Get id from insert duplicate

Alex $servername = "localhost"; $username = "root"; $password = ""; $dbname = "stackoverflow"; $conn = new \mysqli($servername, $username, $password, $dbname); $conn->set_charset("utf8"); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } Obviously I know that t...

He know data will not be inserted because duplicate.. But he want to see duplicate..
I don't get it.. His statement contradict each other..
 
10:21 AM
@Andrew actually you are probably referring to active record pattern used in eloquent etc. I prefer Data Mapper pattern (in Doctrine 2). We basically create our own entities, and then map it to DBAL
 
10:34 AM
DBAL?
 
Database Access Layer (it provides the code for CRUD)
 
@MadhurBhaiya - the objects should be designed to be self contained, atomic / logical units - an ORM doesn't prevent that, but many actively encourage not doing that
 
Exactly, the debate between active record pattern vs Data Mapper pattern.
 
The DB side has far less of a debate on the issue
Don't touch the DB with non-atomic data
I'm not interested in torn domain objects which break integrity
 
10:46 AM
It's not between active record vs data mapper - since an active record can still itself be a domain aggregate
so its not as clear cut as to say - no active records in your terms
 
@Andrew this very much depends on how the code architecture is designed
 
Which is down to the architect - which is the layer I reside in :)
 
normally in enterprise level product(s), architect is not left to the developers. a Lead designs everything and ensure that all the OOPs prinicples and SOLID concepts are followed
 
I'd personally expect an architect to be involved, not just the lead dev
but yes, its not a developer design (for me)
 
I am ok with architect consultant, but generally a Lead has seen so much of software development phases, and various practical upsides/downsides, his inputs are always going to be crucial.
 
10:52 AM
The lead though is not working at the overall strategical level, where as the architect should be - different lead's on different teams can choose opposing solutions - the architect is there to ensure consistency and things meet strategic goals
We are in agreement, but I wouldn't ever expect a lead to take an executive decision on it and not involve architecture to ensure that they are in-line with the strategy / other teams
Most architect's came from development like me - it's not like we havn't seen just as much software as the lead - often we have seen more.
 
hmm. agree on that. my definition of lead was generally VP (tech executive) level person, who leads over various Team leads.
 
VP is a very American term there
 
yeah..pretty much similar hierarchy being followed in Indian MNC (multi-national companies).
 
 
1 hour later…
11:57 AM
Look at this for quick fire answers : stackoverflow.com/questions/53392453/…
4 people answering within about 15 seconds
 
@Andrew that's why sql really like cowboy tag.. Just show your fastest gun..
:D
 
Often can be, depends on the question
And of course, you have to be faster than Gordon
which is not easy :)
 
12:59 PM
But at least GORDON'S ALIVE!!!
 
hi
does function always return a table?
 
No
It always return a value/table
 
yeah? someone was telling me even if it returns a value it is in form of a table
1 row 1 column
lol
 
It depends on you needs
 
if were to get the value of funtion from backend code, should I made my variable the same as return type of the function?
 
1:02 PM
Also, you usually reference it like a table e.g. select * from dbo.myfunction(myparam) as opposed to an SP which is usually select mysp(myparam) from dbo.mytable
 
I see Datatable is used
I use .net
 
1:22 PM
tc
 
 
2 hours later…
2:56 PM
tc
 
The error are clear.. But without data cannot say more..
 
 
3 hours later…
5:56 PM
hi all
question : i have table in which col1 to col5 and val1 to val5 .
now i have to fetch data according to : if col1 match with any other column (col2 to col5) in same row . then add match col no (like col1 and col3 match then add val1 and val3 values)
 
 
3 hours later…
8:30 PM
@Gaurav please post a question. Please provide a relevant and minimal sample data showcasing your requirements, and expected output. Please go through this link once: Why should I provide an MCVE for what seems to me to be a very simple SQL query?
 

« first day (2377 days earlier)      last day (1941 days later) »