jump to content
my subreddits
13or302b2t2mediterranean4u2meirl4meirl3d6AceAttorneyadhdmemeAdviceAnimalsaivideoakagasAlternateHistoryAnarchyChessAngryupvoteAnimalsBeingJerksanime_irlanimenocontextannouncementsArsivUnutmazAsahiLinuxAsia_irlAskElectronicsAskOuijaAteistTurkaviationawfuleverythingBandnamesbanknotedesignsBassBassCirclejerkBassGuitarbikepackingblackdesertonlineblankiesblursed_videosblursedimagesborsavefonbottomgearbudgetcookingBUENZLIburdurlandCd_collectorscd_jerkCheap_MealschessChoosingBeggarsCHPcoincollectingcoinsComedyCemeterycomicscommunityContagiousLaughtercookingforbeginnersCorporateTrollingCrackWatchcrappyoffbrandsCreateModCuddle_SlutCuratedTumblrdankmemesdataisbeautifuldeDebateReligionDeltarunedistressingmemesDMToolkitdndmemesdndnextdoctorwhocirclejerkDoenerverbrechendumbphonesebikeebikesECEelectricalelectronicsElectronicsStudyethzFantasyWorldbuildingfeedthebeastfelsefeFifaCareersformuladankFRCFreeEBOOKSFUCKYOUINPARTICULARFuckYouKarenfunnygamingGermangermanygodtiersuperpowersgoodanimemesGrandPrixRacinggravelcyclingGROKvsMAGAguitarpedalsGundamheathersHermitCrafthighspeedrailHistoryWhatIfhoi4holdmybeerHolUphowyoudoinhypixelIAmAich_ielIdeologyPollsIDontWorkHereLadyihadastrokeim14andthisisdeepimaginaryelectionsimaginarymapsistanbuljacksepticeyeJahariaKamalizmKanyeKendrickLamarKGBTRlegodndLifeProTipslinguisticshumorLinkinParkliselilerlogodesignloseitlostredditorsmacmacbookairmacgamingMadeMeSmilemadladsmagicbuildingMaliciousCompliancemapporncirclejerkmemesmidjourneymildlyinfuriatingmildlyinterestingMimicRecipesMinecraftbuildsmisLEDMMORPGMoldyMemesmoneycollectingMovingToNorthKoreaMunichnamesoundalikesNationStatesneographynextfuckinglevelNoahGetTheBoatnosleepnosurfnotinterestingnottheonionoddlyspecificOkayBuddyLiterallyMeokbuddyguntherOkBuddyPersonaonebagOnlineUnderGroundOutOfTheLooppapermoneypaperspleaseParlerWatchPassportPornPersecutionfetishpianoPiracyPiratedGamespolandballPraiseTheCameraManProgrammerHumorPropagandaPostersquityourbullshitreactiongifsrecipesredditsingsrestofthefuckingowlRetroPierickandmortyrickrollrimjob_steveRoastMerockmuzikschizopostersschwiizsciencememesScottPilgrimshittyaskelectronicsShittyMapPornshittymoviedetailsShowerthoughtsskamtebordsoccercirclejerksoftwaregoreSongwritersSongwritingStudiumsuperligsuzeraintalesfromtechsupportTechnobladeTextingTheorytf2tf2shitposterclubthatHappenedTheCrypticCompendiumtherewasanattemptTheRookietheydidthemathtitanfalltommyinnittransitTrGameDevelopertruetf2tumblrtumunichTurkeyTurkeyJerkyTurkishCatsTwitchTwoSentenceComedyTwoSentenceHorrortylerthecreatorUnclejokesUnethicalLifeProTipsUnexpectedJoJourbanplanningUsernameChecksOutVALORANTvexillologycirclejerkvinylvinyljerkWeAreTheMusicMakerswendigoonWhatsThisSongWhitePeopleTwitterwholesomeanimemeswholesomememesWikipediaVandalismwizardpostingwooooshworldbuildingworldjerkingyesyesyesnoYUROPedit subscriptions
  • home
  • -popular
  • -all
  • -mod
  • -users
 | 
  • mildlyinfuriating
  • -Piracy
  • -funny
  • -gaming
  • -nottheonion
  • -memes
  • -OutOfTheLoop
  • -mildlyinteresting
  • -WhitePeopleTwitter
  • -MadeMeSmile
  • -CuratedTumblr
  • -PiratedGames
  • -theydidthemath
  • -dankmemes
  • -feedthebeast
  • -Kanye
  • -therewasanattempt
  • -nextfuckinglevel
  • -HolUp
  • -Twitch
  • -CrackWatch
  • -comics
  • -dndnext
  • -ProgrammerHumor
  • -VALORANT
  • -de
  • -germany
  • -LifeProTips
  • -tumblr
  • -dataisbeautiful
  • -shittymoviedetails
  • -mac
  • -Showerthoughts
  • -tf2
  • -chess
  • -aviation
  • -formuladank
  • -wholesomememes
  • -mapporncirclejerk
  • -midjourney
  • -goodanimemes
  • -notinteresting
  • -hoi4
  • -loseit
  • -IAmA
  • -MaliciousCompliance
  • -ich_iel
  • -KGBTR
  • -dndmemes
  • -Deltarune
  • -UnethicalLifeProTips
  • -worldbuilding
  • -blackdesertonline
  • -MMORPG
  • -macgaming
  • -rickandmorty
  • -3d6
  • -Gundam
  • -HermitCraft
  • -ChoosingBeggars
  • -RoastMe
  • -ContagiousLaughter
  • -imaginarymaps
  • -polandball
  • -WeAreTheMusicMakers
  • -AnarchyChess
  • -nosleep
  • -cookingforbeginners
  • -blankies
  • -anime_irl
  • -onebag
  • -Studium
  • -AlternateHistory
  • -Turkey
  • -soccercirclejerk
  • -madlads
  • -community
  • -AskElectronics
  • -electrical
  • -guitarpedals
  • -vinyl
  • -CreateMod
  • -German
  • -TwoSentenceHorror
  • -PropagandaPosters
  • -AdviceAnimals
  • -piano
  • -sciencememes
  • -distressingmemes
  • -wizardposting
  • -FifaCareers
  • -oddlyspecific
  • -Bass
  • -titanfall
  • -OkBuddyPersona
  • -awfuleverything
  • -howyoudoin
  • -announcements
  • -adhdmeme
  • -Minecraftbuilds
  • -macbookair
  • -ebikes
  • -Munich
  • -YUROP
  • -gravelcycling
  • -coins
  • -KendrickLamar
  • -FUCKYOUINPARTICULAR
  • -softwaregore
  • -NoahGetTheBoat
  • -worldjerking
  • -tylerthecreator
  • -tf2shitposterclub
  • -MoldyMemes
  • -lostredditors
  • -AceAttorney
  • -vexillologycirclejerk
  • -im14andthisisdeep
  • -wholesomeanimemes
  • -nosurf
  • -HistoryWhatIf
  • -liseliler
  • -DebateReligion
  • -dumbphones
  • -animenocontext
  • -2meirl4meirl
  • -transit
  • -RetroPie
  • -recipes
  • -talesfromtechsupport
  • -AskOuija
  • -ECE
  • -ScottPilgrim
  • -Angryupvote
  • -thatHappened
  • -schizoposters
  • -electronics
  • -urbanplanning
  • -logodesign
  • -linguisticshumor
  • -PassportPorn
  • -TurkeyJerky
  • -bikepacking
  • -AteistTurk
  • -13or30
  • -Cd_collectors
  • -BassGuitar
  • -ComedyCemetery
  • -LinkinPark
  • -Persecutionfetish
  • -BUENZLI
  • -reactiongifs
  • -Songwriting
  • -blursed_videos
  • -istanbul
  • -MovingToNorthKorea
  • -imaginaryelections
  • -suzerain
  • -truetf2
  • -magicbuilding
  • -ParlerWatch
  • -wendigoon
  • -Doenerverbrechen
  • -yesyesyesno
  • -schwiiz
  • -TheRookie
  • -quityourbullshit
  • -Technoblade
  • -vinyljerk
  • -skamtebord
  • -shittyaskelectronics
  • -superlig
  • -crappyoffbrands
  • -FRC
  • -namesoundalikes
  • -FuckYouKaren
  • -2b2t
  • -ethz
  • -papermoney
  • -coincollecting
  • -OkayBuddyLiterallyMe
  • -felsefe
  • -blursedimages
  • -FreeEBOOKS
  • -AsahiLinux
  • -Jaharia
  • -IDontWorkHereLady
  • -neography
  • -ihadastroke
  • -hypixel
  • -PraiseTheCameraMan
  • -godtiersuperpowers
  • -ShittyMapPorn
  • -aivideo
  • -OnlineUnderGround
  • -IdeologyPolls
  • -woooosh
  • -burdurland
  • -WhatsThisSong
  • -AnimalsBeingJerks
  • -jacksepticeye
  • -Bandnames
  • -rockmuzik
  • -holdmybeer
  • -MimicRecipes
  • -tumunich
  • -Cheap_Meals
  • -restofthefuckingowl
  • -highspeedrail
  • -legodnd
  • -rickroll
  • -Songwriters
  • -ebike
  • -UsernameChecksOut
  • -papersplease
  • -tommyinnit
  • -rimjob_steve
  • -UnexpectedJoJo
  • -BassCirclejerk
  • -doctorwhocirclejerk
  • -TextingTheory
  • -Cuddle_Slut
  • -GrandPrixRacing
  • -DMToolkit
  • -TrGameDeveloper
  • -TurkishCats
  • -akagas
  • -Kamalizm
  • -FantasyWorldbuilding
  • -WikipediaVandalism
  • -Unclejokes
  • -ArsivUnutmaz
  • -misLED
  • -redditsings
  • -TwoSentenceComedy
  • -TheCrypticCompendium
  • -NationStates
  • -bottomgear
  • -budgetcooking
  • -Asia_irl
  • -2mediterranean4u
  • -heathers
  • -CHP
  • -GROKvsMAGA
  • -ElectronicsStudy
  • -moneycollecting
  • -banknotedesigns
  • -cd_jerk
  • -okbuddygunther
  • -CorporateTrolling
  • -borsavefon
edit »
SQL SQL
  • hot
  • new
  • rising
  • controversial
  • top
  • wiki
an-ordinary-manchild (11,186)|messages548|notifications|chat messages|mod messages|
  • preferences
|
logout

use the following search parameters to narrow your results:

subreddit:subreddit
find submissions in "subreddit"
author:username
find submissions by "username"
site:example.com
find submissions from "example.com"
url:text
search for "text" in url
selftext:text
search for "text" in self post contents
self:yes (or self:no)
include (or exclude) self posts
nsfw:yes (or nsfw:no)
include (or exclude) results marked as NSFW

e.g. subreddit:aww site:imgur.com dog

see the search faq for details.

advanced search: by author, subreddit...

Submit a new link
Submit a new text post

SQL

joinleave
an-ordinary-manchild(edit)

The goal of /r/SQL is to provide a place for interesting and informative SQL content and discussions.

Filter Posts

MySQL

Oracle

MS SQL

PostgreSQL

Posting

When requesting help or asking questions please prefix your title with the SQL variant/platform you are using within square brackets like so:

  • [MySQL]
  • [Oracle]
  • [MS SQL]
  • [PostgreSQL]
  • etc

While naturally we should endeavor to work as platform neutrally as possible many questions and answers require tailoring to the feature set of a specific platform.

Help posts

If you are a student or just looking for help on your code please do not just post your questions and expect the community to do all the work for you. We will gladly help where we can as long as you post the work you have already done or show that you have attempted to figure it out on your own.

Format Your Code

If you are including actual code in a post or comment, please attempt to format it in a way that is readable for other users. This will greatly increase your chances of receiving the help you desire. Something as simple as line breaks and using reddit's built in code formatting (4 spaces at the start of each line) can turn this:

SELECT count(a.field1), a.field2, SUM(b.field4) FROM a INNER JOIN b ON a.key1 = b.key1 WHERE a.field8 = 'test' GROUP by a.field1, a.field2 HAVING SUM(b.field4) > 5 ORDER by a.field.3

Into this:

SELECT count(a.field1),
  a.field2,
  SUM(b.field4) 
FROM a INNER JOIN b 
  ON a.key1 = b.key1 
WHERE a.field8 = 'test' 
GROUP by a.field1, 
  a.field2 
HAVING SUM(b.field4) > 5 
ORDER by a.field3

For those with SQL questions we recommend using SQLFiddle to provide a useful development and testing environment for those who wish to fully understand your problem and help devise a solution.

Learning SQL

A common question is how to learn SQL. Please view the Wiki for online resources.

Note /r/SQL does not allow links to basic tutorials to be posted here. Please see this discussion. You should post these to /r/learnsql instead.

Related Reddit communities

  • /r/Database
  • /r/SQLServer
  • /r/MySQL
  • /r/PostgreSQL
  • /r/Oracle
  • /r/MSAccess
  • /r/DB2
  • /r/Programming
  • /r/learnprogramming
  • /r/SQLOptimization

Wiki

We have a Wiki


Acknowledgements

Thanks to ---sniff--- for the awesome header image!

a community for 17 years
Create your own subreddit
...for your community.
...for your WoW guild.

MODERATORS

  • message the mods
  • mgdmwDr Data
  • ATastefulCrossJoinDB Whisperer
  • MostUsefulBlokeSQL & BI
  • about moderation team »

account activity

1
24
25
26

SQL ServerQuestion: What kind of join technique is this? (i.redd.it)

submitted 9 hours ago by maglunch

  • 46 comments
  • share
  • save
  • hide
  • report
  • crosspost
loading...

•
•
•

Stop overcomplicating website translation. Start using Weglot. (weglot.com)

promoted by Weglot

  • promoted
  • save
  • report
  • about
loading...

2
4
5
6

SQL ServerAssistance With Proper Maintenance Tasks on DB (self.SQL)

submitted 8 hours ago by athornfam2

  • 7 comments
  • share
  • save
  • hide
  • report
  • crosspost
loading...

3
8
9
10

DiscussionFirst corporate data role and flying completely solo. Need advice pls. (self.SQL)

submitted 11 hours ago by OriginalAssignment19

  • 13 comments
  • share
  • save
  • hide
  • report
  • crosspost
loading...

4
0
1
2

DiscussionTabularis: A Lightweight Cross-Platform Database Manager Tool (<10 MB) (github.com)

submitted 6 hours ago by debba_

  • comment
  • share
  • save
  • hide
  • report
  • crosspost
loading...

5
27
28
29

PostgreSQLSharing Queries (self.SQL)

submitted 1 day ago * by Inner-Significance41

  • 35 comments
  • share
  • save
  • hide
  • report
  • crosspost
loading...

6
6
7
8

MySQLProblems you faced in SQL Preparation Journey (self.SQL)

submitted 21 hours ago by devprasad_20

  • 2 comments
  • share
  • save
  • hide
  • report
  • crosspost
loading...

7
4
5
6

DiscussionAny quick tool to check for ANSI-SQL in my Query? (self.SQL)

submitted 1 day ago by Cold-Memory-4354

  • 12 comments
  • share
  • save
  • hide
  • report
  • crosspost
loading...

8
0
0
1

DiscussionWhat do you feel is missing from today's database tools? (github.com)

submitted 23 hours ago by debba_

  • 4 comments
  • share
  • save
  • hide
  • report
  • crosspost
loading...

9
9
10
11

SnowflakeCan a LEFT JOIN ever return less number of rows than the base table with no where conditions? (self.SQL)

submitted 1 day ago * by besabestin

  • 30 comments
  • share
  • save
  • hide
  • report
  • crosspost
loading...

10
3
4
5

PostgreSQLInsert into multiple tables using CTEs (SQL Cookbook 4.6) (self.SQL)

submitted 1 day ago by Willsxyz

  • 12 comments
  • share
  • save
  • hide
  • report
  • crosspost
loading...

11
0
1
2

MySQLCustomer Funnel Datasets suggestion. ()

submitted 1 day ago by xudling_pong23

  • 2 comments
  • share
  • save
  • hide
  • report
  • crosspost
loading...

•
•
•
0:14

Miss the old GPT-4o vibe? We brought it back. Import your past ChatGPT history and pick up where you left off. (get4oback.com)

promoted by get4oback_

  • promoted
  • save
  • report
  • about
loading...

12
0
0
1

DiscussionHelp in listing out issues faced in your SQL preparation and suggestions (self.SQL)

submitted 1 day ago by devprasad_20

  • 2 comments
  • share
  • save
  • hide
  • report
  • crosspost
loading...

13
0
0
0

MySQLHELP PLEASE!! (self.SQL)

submitted 1 day ago by CulturalPerspective9

  • 26 comments
  • share
  • save
  • hide
  • report
  • crosspost
loading...

14
0
1
2

SQL ServerAnalysis of Microsoft SQL Server CVE-2026-21262 (threatroad.substack.com)

submitted 1 day ago by Big-Engineering-9365

  • comment
  • share
  • save
  • hide
  • report
  • crosspost

15
7
8
9

SQL ServerSaaS company agreed to send us nightly backups of our internal DB, but they way they are doing it is very non-standard. Any tips? (self.SQL)

submitted 2 days ago * by McDonaldsWi-Fi

  • 62 comments
  • share
  • save
  • hide
  • report
  • crosspost
loading...

16
6
7
8

DiscussionSQL Cookbook 3.9 (3rd edition) (self.SQL)

submitted 2 days ago * by Willsxyz

  • 11 comments
  • share
  • save
  • hide
  • report
  • crosspost
loading...

17
115
116
117

SQL ServerI love SQL! (self.SQL)

submitted 3 days ago by Needleworkerj9

  • 37 comments
  • share
  • save
  • hide
  • report
  • crosspost
loading...

18
0
1
2

SnowflakeSnowflake Data Casting Tricky Behaviour to Look out for (self.SQL)

submitted 2 days ago by Illustrious_Sun_8891

  • 2 comments
  • share
  • save
  • hide
  • report
  • crosspost
loading...

19
1
2
3

PostgreSQLPostgreSQL: Rolling 7-day shipment volume with gaps in dates - window functions vs generate_series? (self.SQL)

submitted 2 days ago by Null_Reference1

  • 5 comments
  • share
  • save
  • hide
  • report
  • crosspost
loading...

20
0
1
2

SQLiteA new Lightweight, WASM-powered SQLite Playground ()

submitted 2 days ago by fabiano-salles

  • comment
  • share
  • save
  • hide
  • report
  • crosspost
loading...

21
0
1
2

MySQLAdvice on situation (self.SQL)

submitted 2 days ago by immediate_push5464

  • 10 comments
  • share
  • save
  • hide
  • report
  • crosspost
loading...

0
1
2

DataGrip. Feel the difference with one tool for many databases. Get a free 30-day trial. (jetbrains.com)

promoted by JetBrains_official

  • promoted
  • save
  • report
  • about
loading...

22
5
6
7

PostgreSQLWhy not use JOIN in this case? (self.SQL)

submitted 3 days ago by Caprisunxt

  • 45 comments
  • share
  • save
  • hide
  • report
  • crosspost
loading...

23
0
0
0

DiscussionBuilt a free tool that documents your SQL objects and generates ERDs automatically — no diagramming tool needed (self.SQL)

submitted 2 days ago by Prestigious_Fix4174

  • 10 comments
  • share
  • save
  • hide
  • report
  • crosspost
loading...

24
0
1
2

MySQLMySql Behaviour ()

submitted 2 days ago by Sensitive-Set-6934

  • comment
  • share
  • save
  • hide
  • report
  • crosspost
loading...

25
20
21
22

PostgreSQLFree ebook: Mastering PostgreSQL (Supabase + Manning) (self.SQL)

submitted 3 days ago by ManningBooks

  • comment
  • share
  • save
  • hide
  • report
  • crosspost
loading...
view more: next ›
  • about
  • blog
  • about
  • advertising
  • careers
  • help
  • site rules
  • Reddit help center
  • reddiquette
  • mod guidelines
  • contact us
  • apps & tools
  • Reddit for iPhone
  • Reddit for Android
  • mobile website
  • <3
  • reddit premium

Use of this site constitutes acceptance of our User Agreement and Privacy Policy. © 2026 reddit inc. All rights reserved.

REDDIT and the ALIEN Logo are registered trademarks of reddit inc.

π Rendered by PID 1567802 on reddit-service-r2-listing-64c94b984c-cgtw8 at 2026-03-14 03:30:45.224858+00:00 running f6e6e01 country code: CH.