What is the newest installment of 'Random Thoughts' on Physics Forums?

In summary, the conversation consists of various discussions about documentaries, the acquisition of National Geographic by Fox, a funny manual translation, cutting sandwiches, a question about the proof of the infinitude of primes, and a realization about the similarity between PF and PDG symbols. The conversation also touches on multitasking and the uniqueness of the number two as a prime number.
  • #5,916
I finally figured out the query for the state with the most invoices short version: 5 lines instead of 13. No Over() nor partition.
... 2 years after the interview.
 
Physics news on Phys.org
  • #5,917
Whenever I'm stuck having to use a pen other than a Pilot G-2 I cry a little, inside.
 
  • #5,918
collinsmark said:
Whenever I'm stuck having to use a pen other than a Pilot G-2 I cry a little inside.
Im lucky if a pen lasts me for more than a few days before either fully drying out or having ink all over me when I pick them out.
 
  • #5,919
WWGD said:
I finally figured out the query for the state with the most invoices short version: 5 lines instead of 13. No Over() nor partition.
... 2 years after the interview.
How does it handle the case where multiple states tie for maximum number of invoices?
 
  • #5,920
Ibix said:
How does it handle the case where multiple states tie for maximum number of invoices?
I'll tell you in 2021? Good point. Let me get on my PC , harder to write from my phone. You may be right; I may need some t-sql like cubing, rollup , etc. to take care of that.
 
  • #5,921
Well - first note that it's a question you need to turn back on the questioner: how do I want it to be handled? Can I handle multiple responses, do I want just one and if so which one, or do I want an error?
 
  • #5,922
Ibix said:
Well - first note that it's a question you need to turn back on the questioner: how do I want it to be handled? Can I handle multiple responses, do I want just one and if so which one, or do I want an error?
The idea, as I remember, was to show all records that qualify. So maybe we can use a "With Ties" here I would say. But need to double-check on this last.
 
  • #5,923
Ibix said:
How does it handle the case where multiple states tie for maximum number of invoices?
Not sure, but in the AP Database , using tables Vendors, Invoices, this gave me the triplet
Ibix said:
Well - first note that it's a question you need to turn back on the questioner: how do I want it to be handled? Can I handle multiple responses, do I want just one and if so which one, or do I want an error?
Here is the general 1 with all that qualify (delete the 'Top 1 with Ties' to have just 1 value )

SELECT TOP 1 WITH TIES Count(InvoiceID) Most , VendorState
FROM Vendors V JOIN Invoices I
ON V.VendorID=I.VendorID
GROUP BY VendorState
ORDER BY Most ASC

I guess we could add conditions but I haven't. Seems way advanced to have anything else.

EDIT: Somewhere where I worked someone was shocked when they found out I was saving these , other tables (Using CREATE table, etc) , querying against them and then dropping them. Same as a CTE but I just hated CTEs.
 
  • #5,924
And they accepted my method to delete duplicate although with a raised eyebrow:
Export to Excel, use Excel to delete, import back into SQL Server.
EDIT: But I am looking for one way to do it strictly within MSSMS.
I know how to find the duplicates, but working on a way of deleting them.
 
Last edited:
  • #5,925
WWGD said:
And they accepted my method to delete duplicate although with a raised eyebrow:
Export to Excel, use Excel to delete, import back into SQL Server.
EDIT: But I am looking for one way to do it strictly within MSSMS.
I know how to find the duplicates, but working on a way of deleting them.
Today is crazy data day here! Google localized me in a town I only have been once more than 10 years ago and which is not around the corner. And facebook wants to know how I found Tampa International. @WWGD you aren't involved somehow?

And all flights between the two are 1 stop or 2 stop flights over Atlanta or JFK. Someone messed up the databases.
 
  • #5,926
Me? No, I was in a confusing conversation myself.
" The Greeks were fighting machines"
"Why, if machines can't fight back?"
 
  • #5,927
But maybe someone else SELECT(ED) you (Ha-Ha) in the wrong query.
 
  • #5,928
WWGD said:
But maybe someone else SELECT(ED) you (Ha-Ha) in the wrong query.
Don't know how Google confused my city, but facebook only confused that I didn't watch the game in the Stadion.
 
  • #5,929
fresh_42 said:
Don't know how Google confused my city, but facebook only confused that I didn't watch the game in the Stadion.
How does anyone know what you watched and where you watched it? Not sure I get what you're telling me.
 
  • #5,930
My only possible connection to Tampa was that the Super Bowl was there, and I watched it live, although on tv. Guess facebook thinks this wasn't possible in Germany and concluded I must had been in Tampa.

Correction: was in Miami, not Tampa.
 
  • #5,931
fresh_42 said:
My only possible connection to Tampa was that the Super Bowl was there, and I watched it live, although on tv. Guess facebook thinks this wasn't possible in Germany and concluded I must had been in Tampa.

Correction: was in Miami, not Tampa.
Ask Sugar Hill, only he may know.
 
  • #5,932
WWGD said:
Ask Sugar Hill, only he may know.
I have a contact in Ft Lauderdale, watched the game in Miami, and fb asks me about Tampa. Gotta lock up which age I entered on fb ... all paths lead to FL.
 
  • #5,933
Another strange post elsewhere:
Professor x. 10 years of teaching experience.
How do you teach experience?
Or:
Can Kafka be a database?
I doubt it, he's been dead for almost 100 years and likely has no idea what a database is. Maybe he can think of soneone slowly turning into a database?
 
  • #5,934
I wonder how Kafka reads in English. Not that he knew English.
 
  • #5,935
WWGD said:
I know how to find the duplicates, but working on a way of deleting them.
Look up the ROW_NUMBER function.
 
  • Like
Likes WWGD
  • #5,936
fresh_42 said:
I wonder how Kafka reads in English.
Kafka-esque.
 
  • Like
Likes collinsmark and Klystron
  • #5,937
Ibix said:
Kafka-esque.
It is an interesting name for a product. Not even sure what it is/does.
 
  • #5,938
WWGD said:
Not even sure what it is/does.
Escort service?
 
  • #5,939
fresh_42 said:
Escort service?
Kafka escort? I though it was a database , dbms or related.
 
  • #5,940
WWGD said:
It is an interesting name for a product. Not even sure what it is/does.
If I understand right, it's a tool for managing data that comes from multiple sources and goes to multiple sources in unpredictable bursts. LinkedIn apparently developed it - obviously their data comes in little messages from millions of users whenever they feel like posting something and publish it to your friends or whoever. Apparently it's designed to smooth out "bursty" data to be friendly to network traffic and disk operations. It's "optimised for writing", which is apparently a reference to Kafka the author - hence the name.
 
  • Like
Likes WWGD
  • #5,941
Ibix said:
If I understand right, it's a tool for managing data that comes from multiple sources and goes to multiple sources in unpredictable bursts. LinkedIn apparently developed it - obviously their data comes in little messages from millions of users whenever they feel like posting something and publish it to your friends or whoever. Apparently it's designed to smooth out "bursty" data to be friendly to network traffic and disk operations. It's "optimised for writing", which is apparently a reference to Kafka the author - hence the name.
So it's not then because users may turn into (what was it) caterpillars or butterflies?
 
  • #5,942
WWGD said:
So it's not then because users may turn into (what was it) caterpillars or butterflies?
Or maybe that butterflies turn into users...
 
  • #5,943
I wonder if they chose Kafka instead of more famous writers, e.g., Shakespeare, to avoid Copyright issues (or just plain confusion?)
 
  • #5,944
WWGD said:
I wonder if they chose Kafka instead of more famous writers, e.g., Shakespeare, to avoid Copyright issues (or just plain confusion?)
Jay Kreps chose to name the software after the author Franz Kafka because it is "a system optimized for writing", and he liked Kafka's work.
 
  • #5,945
fresh_42 said:
Jay Kreps chose to name the software after the author Franz Kafka because it is "a system optimized for writing", and he liked Kafka's work.
Danke, both, so not optimized for mental illness. Wonder if Kafka has someone guarding his intellectual property to avoid using this name.
 
  • #5,946
Anyway, thanks for answers and sorry for my kind of absurd obsession with the topic. Maybe Kafkaeske obsession.
 
  • #5,947
WWGD said:
Wonder if Kafka has someone guarding his intellectual property to avoid using this name.
Yes, he had, Max Brod. He published his work instead of burning it.
 
  • #5,948
Kind of weird
fresh_42 said:
Yes, he had, Max Brod. He published his work instead of burning it.
Thanks for the Max(Broad) tip, I am dealing with Min(Row_Number) per @Ibix tip.

I owe you one @Ibix, just figured out how to deleated repeated rows in a table. I had to :
create a new table , insert data and then use Row_Number to delete repeated entries.
Thanks, Bro!
 
  • #5,949
fresh_42 said:
Escort service?
Why would I escort service. Where do I escort them to? Greeks were fighting machines. I am not fighting machines.
 
  • #5,950
Kind of weird
Ibix said:
Look up the ROW_NUMBER function.
There is a surprisingly simpler way of doing this: SELECT Distinct * FROM [Table_Name]
 

Similar threads

34
Replies
1K
Views
30K
Replies
3K
Views
143K
Replies
2K
Views
156K
Replies
4K
Views
213K
Replies
4
Views
2K
Replies
8
Views
1K
Back
Top