Press J to jump to the feed. Press question mark to learn the rest of the keyboard shortcuts
View
Sort
Coming soon

The show should have been 3 seasons. First two seasons were excellent, the 3rd and final season should have been the meat of what was in the 4th season, with the "OMG being president is hard" stuff from the 3rd season squeezed in, with a final concusion that wrapped the series up in the final episode. The 5th season was a joke. I'm not even going to watch whatever they're releasing for the Spacey-less final season.

Quit upvoting these dumb fucking videos.

see more

Thanks for the valuable insight /u/punchuinface55

Original Poster1 point · 20 days ago

Did you rename the vessel code fields in each table with a v.vessel_code for the vessel table and p.vessel_code for the policy table so you could tell them apart while writing your query?

see more

nah, I used the Aliases if the column existed in two different tables. For example, vessel_code exists in multiple tables. So I need to tell SQL Server not only the column name, but also which table. Otherwise it doesn't know if I mean claims.vessel_code or vessel.vessel_code. With aliases, that would be c.vessel_code or v.vessel_code. I need to clarify the table, or else it will say the column name is ambiguous

Comment deleted20 days ago

it's because in your select statement, ou are still using the full names. Policies is now P, so it should be p.policy_no. Not policies.policy_no

Load more comments

Nicklaus = GOAT

Sorry, Tiger

see more

Nicklaus = G(career)OAT

Tiger = G(talent)OAT

Tiger in his prime was leaps and bounds beyond Nicklaus. But his star shined too bright and he fizzled out early. After completing the Tiger Slam there wasn't a person alive who didn't think he would blow past Jack's major record like a pit stop on a lonely highway. But alas, he was Icarus, and he flew too close to the sun. He went off the rails and lost his way, doing Navy Seals boot camps and banging porn stars. The crack in the damn was him losing the PGA on a Sunday with the lead in 2009 to YE Yang, but if you want my opinion, I think it started 3 years before that... when Earl died. His Dad passed away in 2006, and when he won the Brittish Open a few weeks later he cried like a baby on Stevie's shoulder on the 18th green in front of everyone. His father made him, and he was his rock. Tiger was tough as nails, but without his dad, something changed in him. I think his dad dying is what broke him. People deal with grief in different ways, but I think his coping mechanism was boot camp and porn stars. He had injuries also. But I think it was mostly boot camp and porn stars.

Showing Johnny Miller up is great

see more

Yea but have you heard he shot 63 on a Sunday to win the 1973 US Open at Oakmont? Johhny Miller wants you to know this fact, and just in case you ever forget, he will remind you every 5 minutes if you ever watch golf on NBC.

Casey played poorly on the home stretch there. Solid round by Bubba. Was hoping JB Holmes would give more fight there at the end.

see more

I want to pull for JB. Grew up with him in Campbellsville, he's a decent guy, known him since we were little kids, we're actually second cousins but OMG HE PLAYS SO FUCKING SLOW IT KILLS ME! Like dude hit the fucking shot. Stop plumb-lining it on every. single. fucking. putt. and taking 60 thousand practice swings. Holy Fuck!

good job man, hope your team goes deep

1 point · 1 month ago · edited 1 month ago

Since it's a bunch of dudes for a bachelor party, why not do Top Golf? I went there last time I was in Vegas with my teammates for a billiards tournment and we had a blast. You can get a few booths together and you all can hang out and socialize and while servers bring you drinks. Meanwhile you can hit balls at the targets, play games and take in the Vegas skyline.

And 32 years to count to a billion, right? I learned that in ninth grade and it's been almost a billion seconds since then... well hey, that's terrifically depressing.

see more

This is the example I use when telling people how insane the odds are in winning the lottery. It would be like picking 1 exact second from the past 8 years correctly (250 million to 1). Think about that. Not just getting the right year, but the right month, day, hour, minute and second. Impossible.

2 points · 1 month ago

April 30 2015 1pm 31 min 29 sec is equal to what set of numbers on the power ball?

see more
1 point · 1 month ago · edited 1 month ago

Here you go...

I wrote a script, you can test it here : https://dotnetfiddle.net/PeiDl4

Click the Run button at the top. It brute forces the possible lottery combos kind of like an odometer in a car, incrementing from right to left. Starts with the Powerball number then works its way backwards towards the numbers in position 5, then position 4 etc from lowest possible combo (1-2-3-4-5-1) to highest (65-66-67-68-69-26). When the combo number matches up to the seconds into the past, it stops and gives you the numbers. Keep in mind, time doesn't stop. So the number of seconds between now and then is always getting bigger. Every time you run this the numbers will be different. As of this exact moment though, the numbers are 6-11-24-34-36-6.

Callaway SuperSofts. Its definitely worth it to hang on to it and return it for the beer. I was paired with him last time out and that’s how I found out this was even a thing.

Edit: If I ever find one i’ll remember to share it on here

see more

I too play supersofts. Might steal this idea for my club.

I can't believe this site is that popular. I started using it regularly around 2010... anyone know how popular it was back then? Feels like it was a lot smaller

Congrats on your new balls sir!

I'm a registered independent and KY has closed primaries. See y'all at the general

5

I have a table called xml_data with two columns: unique_id, xml_data. Each record in the table has different XML data in the xml_data column. Let's assume the XML schema looks something like below.

        <ORDER ORDER_NAME="4800924">
          <ORDER_LINE LINE_NUM="1">
            <PROD NAME="A">
              <UOM_WEIGHT>0.31</UOM_WEIGHT>
            </PROD NAME>
          </ORDER_LINE>
          <ORDER_LINE LINE_NUM="2">
            <PROD NAME="B">
              <UOM_WEIGHT>0.32</UOM_WEIGHT>
            </PROD NAME>
          </ORDER_LINE>
          <ORDER_LINE LINE_NUM="3">
            <PROD NAME="C">
              <UOM_WEIGHT>0.33</UOM_WEIGHT>
            </PROD NAME>
          </ORDER_LINE>
        </ORDER>

Ok let's say I am searching for product B, and I want the following result set to return all records only where PROD/@NAME = 'B'...

   | ORDER_NAME | ORDER_LINE | PROD_NAME | UOM_WEIGHT |

If I were searching ONLY this one single record of XML I could do something like...

select xml_data.value('(/ORDER/@ORDER_NAME)[1]', 'varchar(max)') as ORDER_NAME,
   xml_data.value('(/ORDER/ORDER_LINE/@LINE_NUM)[2]', 'varchar(max)') as ORDER_LINE,
   xml_data.value('(/ORDER/ORDER_LINE/PROD/@NAME)[2]', 'varchar(max)') as PROD_NAME,
   xml_data.value('(/ORDER/ORDER_LINE/PROD/UOM_WEIGHT)[2]', 'varchar(max)') as WEIGHT
from xml_table 
where  unique_id = 'blah'

and put numbers in the brackets [1], [2] etc because I know exactly which Elements have the product I am looking for.

However, what I need is this same result set for ALL records in the xml_table and the product I'm looking for could be in ANY order_line element.

Is there a way to effectively make the element level a wild card? I know this isn't correct syntax, but something like

 select xml_data.value('(/ORDER/@ORDER_NAME)[1]', 'varchar(max)') as ORDER_NAME,
   xml_data.value('(/ORDER/ORDER_LINE/@LINE_NUM)[*]', 'varchar(max)') as ORDER_LINE,
   xml_data.value('(/ORDER/ORDER_LINE/PROD/@NAME)[*]', 'varchar(max)') as PROD_NAME,
   xml_data.value('(/ORDER/ORDER_LINE/PROD/UOM_WEIGHT)[*]', 'varchar(max)') as WEIGHT
from xml_table 
where  xml_data.value('(/ORDER/ORDER_LINE/PROD/@NAME)[*]', 'varchar(max)') = 'B'

instead of a hard coded integer for the element tree so that it returns results from ANY element that has the specific value I am looking for? That is effectively what I am trying to do.

Hopefully the question I am asking makes sense, if not I will try to clarify more. Thanks for anyone who can help.

5
2 comments

Hi, I just had to write a similar query, hopefully it's not too late to be helpful for you.

DECLARE @XmlData XML = 
'<data>
  <employees>
    <employee>
      <id>10</id>
      <jobcodes>
        <jobcode>
          <jobcodeid>8</jobcodeid>
          <payrate>0.0000</payrate>
        </jobcode>
      </jobcodes>
    </employee>
    <employee>
      <id>14</id>
      <jobcodes>
        <jobcode>
          <jobcodeid>300</jobcodeid>
          <payrate>0.0000</payrate>
        </jobcode>
        <jobcode>
          <jobcodeid>400</jobcodeid>
          <payrate>11.0000</payrate>
        </jobcode>
      </jobcodes>
    </employee>
  </employees>
</data>'

SELECT
    employee.value('(/employee/id)[1]', 'INT'),
    jobCode.value('(/jobcode/jobcodeid)[1]', 'INT'),
    jobCode.value('(/jobcode/payrate)[1]', 'FLOAT')
FROM
    (
        SELECT
            employeeData.query('.')
        FROM
            @XmlData.nodes('data/employees/employee') AS XmlEmployees(employeeData)
    ) AS Employees(employee)
    OUTER APPLY
    (
        SELECT 
            jobCodeData.query('.')
        FROM
            employee.nodes('employee/jobcodes/jobcode') as XmlJobCodes(jobCodeData)
    ) AS JobCodes(jobCode)

Doing this breaks it out into a more queryable format. Let me know if you have any further questions

see more
Original Poster1 point · 2 months ago

Thank you so much for this. I ended up doing something else after this post, but I came back here later when I needed to do something similar for one of our configs with multiple threads. This was a life saver, thanks again! Here's what I ended up writing for mine...

declare @config_data as xml;

set @config_data = (select config_data from config_header where config_id = 'C9E0AD1C-9273-4719-A57D-68E787FA958B')

select THREAD.value('(THREAD/@name)[1]', 'varchar(max)') as thread_name,

`THREAD.value('(THREAD/@txn_type)[1]', 'INT') as txn_type`

from (

`select configData.query('.')`

`from @config_data.nodes('(/CONFIG)') as xmlConfig(configData)`

) as Configs(CONFIG)

outer apply (

`select threadData.query('.')`

`from CONFIG.nodes('(/CONFIG/THREAD)') as Threads(threadData)`

) as Threads(THREAD)

Louisville? Never played over there, how is it?

see more
Original Poster1 point · 2 months ago

Except for tee shots off of #1 and #10, it's flat and very walkable. It's down in a valley, doesn't drain water well after a lot of rain, but I like it.

I’ve heard it said the difference between a scratch golfer and a tour player is a bigger differential than between a scratch golfer and a 30 handicap. Even though pros are usually +8 or so, there’s just a huge unmeasurable difference there; partly due to the difficult course setups they play. A tour pro could likely play a local muni track and come close to a 59 with their B-game.

see more

Revenue by Product Category

select CategoryName, sum(Quantity * Price) as Revenue
from Categories c
    join Products p on p.CategoryID = c.CategoryID
    join OrderDetails od on od.ProductID = p.ProductID
group by CategoryName
7

Bonus prediction: Trump and his base will claim vindication. The left will continue to sit back and do nothing except whine about it, all while proceeding to lose the midterm elections.

7
5 comments
1 point · 2 months ago

No demonstrations?

see more
Original Poster1 point · 2 months ago

Doubt it. People are too lazy and complacent. We roll our eyes and make snarky comments on the interwebs, but in the end no real action ever happens

  1. This would almost certainly harm the Republicans in the midterms, and they're not in a good place to begin with.

  2. Gorsuch has already demonstrated that he is willing to rule against Trump in a 5-4 case when it comes to the rule of law. I wouldn't be surprised if that was the case again here, if it came to it.

see more
Original Poster2 points · 2 months ago · edited 2 months ago

Good points, but counter argument for #1: Democrats are historically terrible at showing up at the polls in midterms and #2 the recent split you are referring to is not because Gorsuch is a secret liberal. There is a much larger ulterior motive. Check out the recent episode of podcast Opening Arguments if you want more info.

Edit: link https://openargs.com/oa167-neil-gorsuch-secret-liberal/

A Wild Roach appears on wall in background at 2:45

1

Planning a trip abroad for 3 months. Are there websites that will allow me to rent my 3 bedroom house for 3 months besides airbnb? I would like to find one tenant for the whole 3 months if possible. I know I could list on airbnb, but Im afriad I would only get people looking for 1 or 2 nights here and there. I would rather have a long term tenant on a short term contract. Thanks!

Edit: Location, Louisville Kentucky

1
6 comments

Like an unskilled poker player going all in with a pair of dueses and hitting a full house on the river.

see more

As a frequent poker player who has been on the receiving end of many bad beats, this analogy is perfect.

2 points · 3 months ago · edited 3 months ago

I am assuming you have an Artist table and the primary key is ArtistID. You also have a Genres table and the PK is GenreID. The artists and genres should be listed once and only once in these tables. In your composite table MusicArtists_Genres, it's sole purpose is to link Artists to Genres. You only need the two PK columns from Artists and Genres (ArtistID, GenreID) in this table, and individually they are Foreign Keys. However, each unique combination of these two columns together now makes up the Primary Key of this new composite table. The whole point of normalization is to avoid redundancy. It's ok to have the same GenreID listed multiple times in this table as Foreign Keys as long as each combination of GenreID + ArtistID is unique (and serves as this table's PK).

Original Poster1 point · 3 months ago · edited 3 months ago

Yes--correct, this is the setup that I have currently if I am understanding your description. What I am not clear on is the best way to populate these types of tables..just manually?

https://i.imgur.com/ci9TVUW.png

see more

It depends on where your data is stored currently. Do you have an existing table that has the artists and genres already listed in a Songs table or something similar as /u/maunaloona suggested? If so you could do something like this with a temp table ...

--get each unique pairing of artistid and genreid and insert the records into a temp table
SELECT ArtistID, GenreID INTO #temp  FROM Songs GROUP BY ArtistID, GenreID;

--then insert the records from the temp table
INSERT INTO MusicArtists_Genres SELECT * FROM #temp

Or if your data is in something like an Excel spreadsheet or a text file, you can use the import wizard to upload it into the database, then manipulate it as needed from there.

u/skibblez_n_zits
Karma
113,331
Cake day
January 5, 2012
Trophy Case (2)
Six-Year Club

Verified Email

Cookies help us deliver our Services. By using our Services or clicking I agree, you agree to our use of cookies. Learn More.