Run SQL queries in EXCEL (just like a normal Excel formula 🤯)

Поделиться
HTML-код
  • Опубликовано: 3 ноя 2024

Комментарии • 146

  • @CodingIsFun
    @CodingIsFun  2 года назад +17

    *Do you use SQL at your job?* 🤔

    • @michaelomosebi6374
      @michaelomosebi6374 2 года назад

      I get the error: "Could not activate Python COM server, hr=-2147221164" 😣😣

    • @SaulEduardoo2
      @SaulEduardoo2 2 года назад +1

      Hi Sven, I don't used, I don't even know how to program in SQL, but, use SQL will allow me to create database more ease to manipulate instead of having all the data in excel.

    • @channelbtv2903
      @channelbtv2903 Год назад

      Thank you sir, do you have any tutorial using dynamic SQL instead of statik syntac SQL in excell?

    • @CodingIsFun
      @CodingIsFun  Год назад

      @@channelbtv2903 nope

    • @Russels_Viper
      @Russels_Viper Год назад

      Can this work with Oracle ?
      If yes, how do I go about doing it .

  • @plavali_znaem
    @plavali_znaem Год назад +3

    The content of this channel is sooo underrated!! It’s not the first time I search for something very specific and end up here finding exactly this and more over my expectations!! 🎉🎉
    Weiter so, Sven! Danke sehr!

    • @CodingIsFun
      @CodingIsFun  Год назад

      Ah, you're making me blush! Thanks for the kind comment and happy to hear that you're enjoying the videos! ♥💪

  • @TonySitterly
    @TonySitterly 6 месяцев назад +2

    I love SQL and hate pivot tables - This is awesome!
    Thanks!

    • @CodingIsFun
      @CodingIsFun  6 месяцев назад

      Glad I could help! Cheers, Sven ✌️

  • @alanmusic3495
    @alanmusic3495 6 месяцев назад

    This is just AMAZING! Is so much better than using python/pandas on the termina!!! I dont know why people arent talking about this.... I was searching for something like this and you were the only video I found. Keep it up!

    • @CodingIsFun
      @CodingIsFun  6 месяцев назад

      Happy to hear that it was useful; thank you for taking the time to leave a comment and for watching the video! Cheers, Sven ✌️

  • @kuuuyajim
    @kuuuyajim 2 года назад +4

    Wow! This is similar to the FILTER function but more advanced and easier to do if you know or prefer to use SQL for filtering. I can't think of a use case for my current job but it's a handy piece of knowledge to have. Thank you very much for sharing! 😉

    • @CodingIsFun
      @CodingIsFun  2 года назад +3

      Thanks for watching. I totally agree. It is probably not what I need/use every day, but it is good to know and a great way to keep practising SQL.

    • @michaelomosebi6374
      @michaelomosebi6374 2 года назад +1

      Thanks for this tip. I have a use case that will benefit from this FILTER function you just mentioned. Been on it for some days now.
      My PC keeps freezing once I input the sql function 😣😣

    • @Mukdeni
      @Mukdeni 2 года назад

      Thank you for sharing! This is very useful in my daily work

  • @hamzakrack
    @hamzakrack 6 месяцев назад +1

    Thanks man this is huge and it saves me a lot of time, but why excel doesn't have this included (or a similar feature) is beyond my understanding

    • @CodingIsFun
      @CodingIsFun  6 месяцев назад

      Glad I could help! Thanks for watching. Cheers, Sven ✌️

  • @mubafaw
    @mubafaw 10 месяцев назад

    Exactly what I was looking for. Excellent!!!!! Thanks😊👍

    • @CodingIsFun
      @CodingIsFun  10 месяцев назад +1

      Happy to hear that it was useful; thank you for taking the time to leave a comment and for watching the video!

  • @berbarmoumen1847
    @berbarmoumen1847 8 месяцев назад

    ❤❤❤😂😅 Merci beaucoup pour votre aide. From Algeria

    • @CodingIsFun
      @CodingIsFun  7 месяцев назад

      Thanks for watching! Cheers, Sven ✌️

  • @PirieHart
    @PirieHart 10 месяцев назад

    (1) How do you configure conditional formatting for output from the SQL() function?
    (2) Does the SQL() function support UPDATE or other SQL statements?
    Thank you for a very useful video!

    • @CodingIsFun
      @CodingIsFun  10 месяцев назад

      Thanks for watching! I'm not entirely certain about how or if it will work. Please feel free to give it a shot and see how it goes :)

  • @samaritanx9609
    @samaritanx9609 2 года назад +1

    Hi Sven, one more golden feather... shown great thing.. 💌

  • @andybecker5001
    @andybecker5001 Год назад +1

    This is great! No idea this could be done

    • @CodingIsFun
      @CodingIsFun  Год назад

      Glad you liked it. Thanks for watching and taking the time to leave a comment!

  • @gagansingh3481
    @gagansingh3481 23 дня назад

    @coding is fun - But we have column which is blank rest others columns have value then how to filter the blank value with related columns with it .....

    • @CodingIsFun
      @CodingIsFun  22 дня назад

      Thank you very much for watching the video and your comment. Your requirements are well noted. Yet, I receive many requests for creating individual solutions. As much as I want to help, I simply do not find the time in my daily schedule to develop & test all the different requests. I hope you can understand. Thank you! -Sven

  • @soutasimportagencies
    @soutasimportagencies Год назад

    Thank you very much for the excellent tutorial.

    • @CodingIsFun
      @CodingIsFun  Год назад

      Glad you liked it. Thanks for watching! 👍

  • @hasanmougharbel8030
    @hasanmougharbel8030 2 года назад

    Hey there,
    God bless your efforts.
    I have only a general enquiry as a new sql learner.
    Suppose i created one table on sql management studio for data entry purpose...
    How can i compile this sql table into a windows application? In what compiler should i placed it?
    The reason i am asking that i would like to discover how an sql application is finally presented as an application...
    THanks for taking care of this

    • @CodingIsFun
      @CodingIsFun  2 года назад

      Thank you for watching the video and for your question. Unfortunately, I do not know how to implement that right off the bat. I would also need to search the internet for a solution. Sorry that I cannot help!

  • @sergeysergey421
    @sergeysergey421 2 года назад +1

    Very cool! I think Microsoft have to update Power Query tool for python and sql dialects. Pandas, sql have same language structure in my opinion.

  • @gamenotfound9376
    @gamenotfound9376 Год назад

    Great video! Just a question, how did you empty the worksheet from cells and automatically format the query result? Thanks!

    • @CodingIsFun
      @CodingIsFun  Год назад

      Sorry, but I do not know what you mean

  • @grev201
    @grev201 2 года назад +1

    Is it possible to use variable declaration? Example, cell A1 has value as date
    declare @date_s date = A1
    select * from table a where a.DateDocument = @date_s

    • @CodingIsFun
      @CodingIsFun  2 года назад +1

      Thank you for watching the video and for your excellent question. Right off the bat, I am not sure if that is possible. I would suggest trying it out yourself. There is not much setup/installation required, as shown in the video. Happy Coding!

  • @chaitanyadeshmukh1404
    @chaitanyadeshmukh1404 2 года назад

    This so much fun. Will definitely use it. 💯

  • @sheikhraisulislam4483
    @sheikhraisulislam4483 2 месяца назад

    really intriguing

  • @brunoestrella598
    @brunoestrella598 2 года назад

    Great job ! Thanks for sharing !

    • @CodingIsFun
      @CodingIsFun  2 года назад +1

      You're very welcome! Thank you for watching and for the comment!

  • @alexrosen8762
    @alexrosen8762 2 года назад

    Extremely useful since I work a lot in Excel. Many thanks

    • @CodingIsFun
      @CodingIsFun  2 года назад +1

      An absolute pleasure, very happy to hear that you found it useful!

  • @bongrrjr
    @bongrrjr Год назад

    Would you happen to have more SQL query sample? Thanks in advance.

    • @CodingIsFun
      @CodingIsFun  Год назад

      Thanks for watching. These are just some sample SQL queries. For your specific use case, you would need to write your own SQL queries.

  • @ddmittal420
    @ddmittal420 9 месяцев назад

    Hi, thanks for the video. How do I convert datetime to date in the sql query of xlwings. The sql server functions like CONVERT don't seem to work. Thanks

    • @CodingIsFun
      @CodingIsFun  9 месяцев назад

      Thank you for watching. XLWings uses SQLite under the hood, so you might want to try using strftime. Please note that I have not tested it. Happy coding! Cheers, Sven! ✌️

    • @ddmittal420
      @ddmittal420 9 месяцев назад

      @@CodingIsFun strftime worked for me. Thanks so much!

  • @rianne465
    @rianne465 6 месяцев назад

    Because of company policy, I have Sophos install and when I create the query, it shuts down Excel, because of 'malicious behavior'...

  • @dwaipayanbandyopadhyay6110
    @dwaipayanbandyopadhyay6110 Год назад

    How to use each table separately ? Like to fetch data from table 2 i.e b we have to use a , is it possible just to fetch data from b or c ?

    • @CodingIsFun
      @CodingIsFun  Год назад

      Thanks for watching. I would suggest to download the sample file from the description. Afterwards, you can play around with your SQL queries and see if you run into any issues. Thanks!

  • @richievellalar3214
    @richievellalar3214 3 месяца назад

    you can use Filter F right ?

    • @CodingIsFun
      @CodingIsFun  3 месяца назад

      Thanks for watching. I have not tried that. Feel free to give it a try. Cheers, Sven ✌️

  • @pawekurantowicz3748
    @pawekurantowicz3748 Год назад

    Hey,
    I have a question with CONVERT metod, it's not working on EXCEL, is there a way to make it work?

    • @CodingIsFun
      @CodingIsFun  Год назад

      Thanks for watching. I am not sure about that. Sorry, that I cannot help!

  • @syazwanizulkhairi9972
    @syazwanizulkhairi9972 Год назад

    Can we use update, insert, delete, create in this xlwings?

    • @CodingIsFun
      @CodingIsFun  Год назад

      Thanks for watching. I have not tried it out

  • @sagargupta5591
    @sagargupta5591 14 часов назад

    File not found: xlwings64-0.33.3.dll
    I'm getting this error when I run the sql query in the excel sheet. Could you please help me?

    • @CodingIsFun
      @CodingIsFun  13 часов назад

      Here you are: docs.xlwings.org/en/stable/troubleshooting.html

  • @sibisanjai741
    @sibisanjai741 Месяц назад

    I am facing the issue please help me out
    but already installed ( pip install xlwings )
    C:\Users\sibis>xlwings addin install
    'xlwings' is not recognized as an internal or external command,
    operable program or batch file.
    C:\Users\sibis>

    • @CodingIsFun
      @CodingIsFun  Месяц назад

      Thanks for watching. Please try the following:
      chatgpt.com/share/738b8329-f7eb-4fae-acdf-f51f3f08d924
      Cheers, Sven ✌️

    • @sibisanjai741
      @sibisanjai741 Месяц назад

      @@CodingIsFun i already tried in chat gpt and online blogs also still facing the issue i raised the issue in github xlwings repo i will check

    • @CodingIsFun
      @CodingIsFun  Месяц назад

      @@sibisanjai741 good luck 🤞

  • @MAKEININDIA-q6m
    @MAKEININDIA-q6m Год назад

    'xlwings' is not recognized as an internal or external command,
    operable program or batch file. what to to in this case, please help

    • @CodingIsFun
      @CodingIsFun  Год назад

      Hard to tell from a distance. My closest guess is that you are getting this issue because you are trying to import a module of a library which is not installed in your virtual environment. If you have run 'pip install xlwings' already, ensure to call your Python file from the same environment in which you installed the package. For example, in your IDE/text editor, you might have set a different Python environment for executing your script. Therefore, try to run your Python file also from the command prompt. If that does not work, try searching for the text of your error message on Google/StackOverflow. Happy Debugging!

  • @kushagramishra7505
    @kushagramishra7505 Год назад

    How you have assigned "a" to the table ? Can we assign different name to the table if yes then how?

    • @CodingIsFun
      @CodingIsFun  Год назад

      I have not assigned an Excel table, but in the formula the first table is referred to "a", the second one to "b" and so on. To my knowledge, you cannot change the names.

  • @adbarlev
    @adbarlev 9 месяцев назад

    When filling the function arguments, I get Formula result = "Could not load xlwings64-0.30.13.dll from either of the following folders: ... any suggestions?

    • @CodingIsFun
      @CodingIsFun  9 месяцев назад +1

      Thanks for watching. Please have a look here: docs.xlwings.org/en/stable/troubleshooting.html
      I hope it helps! Cheers, Sven ✌️

  • @albertoghiglia9566
    @albertoghiglia9566 2 года назад

    Hi. I got this error message "Python process exited before it was possible to create the interface object..... Working Dir: ." Maybe there is a place where to specify a connection string for the SQL server database?

    • @CodingIsFun
      @CodingIsFun  2 года назад

      Hard to tell from a distance. I assume this might be due to your Python Path settings: github.com/ericremoreynolds/excelpython/issues/52

  • @jawadbari9481
    @jawadbari9481 Год назад

    Hi, thank you so much, loved this, however im facing an issue my quries are working well, but when i try to find result by giving date parameter in my query its giving me blank result, for example my coloumn A of table having date in date formate "25-Jun-20" but how to write in query the date format so i can get the result of this date im tryping this in my where clause (where "Bill Date" = "20200625" but result is blank please help me in this

    • @CodingIsFun
      @CodingIsFun  Год назад +1

      Thank you for watching the video and for your question. Unfortunately, I do not know how to implement that right off the bat. I would also need to search the internet for a solution. Sorry that I cannot help!

    • @jawadbari9481
      @jawadbari9481 Год назад

      @@CodingIsFun I got the solution, although it costed me alot of time :P

    • @CodingIsFun
      @CodingIsFun  Год назад

      @@jawadbari9481 feel free to share it here :)

  • @mikaelapurugganan8006
    @mikaelapurugganan8006 Год назад

    One question. I was trying to get the yearly sales (I've been working on something). It says OperationalError: no such function: YEAR. Can someone please help me?

    • @CodingIsFun
      @CodingIsFun  Год назад +1

      Thanks for watching. Under the hood, xlwings utilizes SQLite. SQLite does not have a "YEAR" function, however you could try something like this:
      SELECT strftime('%Y', date_column) AS year FROM your_table;
      Good luck!

    • @mikaelaq.purugganan4367
      @mikaelaq.purugganan4367 Год назад

      @@CodingIsFun Thank you so much! You're a life savior.

  • @andfanilo
    @andfanilo 2 года назад +1

    Well I can again tell my students that learning SQL will get them anywhere, even using Excel 😃

    • @CodingIsFun
      @CodingIsFun  2 года назад

      haha, that's right. Excel ♥

  • @LateNightsAllDay
    @LateNightsAllDay 2 года назад

    I was on one of ur previous videos about dataframes to excel in python I have files that need to be extracted that were created with pandas etc I dont code but I need the data from these files anyway u could help?

    • @CodingIsFun
      @CodingIsFun  2 года назад

      Thank you for watching the video. Kindly understand that I receive many requests for individual solutions or modifications. That said, you might want to join our Discord server (pythonandvba.com/discord ) and post your question there. Thanks for your understanding. Happy Coding!

    • @LateNightsAllDay
      @LateNightsAllDay 2 года назад

      @@CodingIsFun I posted thank you hope its possible

  • @gamenotfound9376
    @gamenotfound9376 Год назад

    Problem: This add-in makes every resulting cell an Array. How can I convert the result into normal numbers/letters? I can't copy the results.

    • @CodingIsFun
      @CodingIsFun  Год назад

      Thank you for watching the video and for your question. Unfortunately, I do not know how to implement that right off the bat. I would also need to search the internet for a solution. Sorry that I cannot help!

  • @jrabaona
    @jrabaona 2 года назад

    Why does Joseph Slatter write a book untitled "Subscribe" ? 😆😆😆 just jokin, thanks a lot for your amazing work

    • @CodingIsFun
      @CodingIsFun  2 года назад

      haha 😅 Thanks for watching and your comment! :)

  • @GurinderSingh-mh1ln
    @GurinderSingh-mh1ln Год назад

    Hi please helo I m getting an error - File not found: xlwings64-0.11.8.dll

    • @CodingIsFun
      @CodingIsFun  Год назад

      Did you install xlwings and the add-in?

  • @MackieGamePlay
    @MackieGamePlay 9 месяцев назад

    Do you have sample for UPDATE Function?

    • @CodingIsFun
      @CodingIsFun  9 месяцев назад +1

      Nope, I have not tested it. Feel free to test it out yourself :)

    • @MackieGamePlay
      @MackieGamePlay 9 месяцев назад

      @@CodingIsFun I encountered an error, it says 'NoneType' Object is not iterable
      My SQL is:
      UPDATE a
      SET JOB = 'SENIOR MANAGER'
      WHERE E_NO = 20;

  • @MehakKatnoria-f1q
    @MehakKatnoria-f1q 10 месяцев назад

    Can i execute INSERT query the same way ?

    • @CodingIsFun
      @CodingIsFun  10 месяцев назад

      Feel free to give it a try

    • @mehakk_02
      @mehakk_02 10 месяцев назад

      I did.. but it said “sqlite3 operational error near insert”. I tried multiple times☹️

    • @CodingIsFun
      @CodingIsFun  10 месяцев назад

      @@mehakk_02 then I guess it's not possible :(

    • @mehakk_02
      @mehakk_02 10 месяцев назад

      Oh!! Thanks anyways✌🏻

  • @iDea16388-c
    @iDea16388-c 2 года назад

    Thank you

    • @CodingIsFun
      @CodingIsFun  2 года назад

      Glad you liked it. Thanks for watching.

  • @nikhilwaghalkar1271
    @nikhilwaghalkar1271 Год назад

    Getting error for second command xlwings is not recognised as an internal or external command.

    • @CodingIsFun
      @CodingIsFun  Год назад

      Did you install xlwings?

    • @nikhilwaghalkar1271
      @nikhilwaghalkar1271 Год назад

      @@CodingIsFun yes

    • @CodingIsFun
      @CodingIsFun  Год назад

      @@nikhilwaghalkar1271 what have you tried to troubleshoot?

    • @nikhilwaghalkar1271
      @nikhilwaghalkar1271 Год назад

      I reinstall xlwings with "pip install xlwings" but it is already present and then tried to run xlwings addin install but unfortunately getting same error xlwings not found as internal or external command.

  • @physicsmostafa1774
    @physicsmostafa1774 Год назад

    SQL is much clear and well documented than Microsoft DAX

    • @CodingIsFun
      @CodingIsFun  Год назад

      Thank you for watching the video and taking the time to leave a comment! 👍

  • @samuely1-v3z
    @samuely1-v3z Год назад

    How can i write code more than 255 characters??

    • @CodingIsFun
      @CodingIsFun  Год назад

      Can you explain what you mean?

    • @samuely1-v3z
      @samuely1-v3z Год назад

      Have you tried to run a bit mote complex code ? It is easily exceed char 255 which is the limited of a cell, can you solve it ?

    • @CodingIsFun
      @CodingIsFun  Год назад

      @@samuely1-v3z Yes. Excel cells can have chars > 255, see example: www.screencast.com/t/fflBEuiMrW

  • @HeartistMurali
    @HeartistMurali 2 месяца назад

    The command 'xlwings addin install' is not working

    • @CodingIsFun
      @CodingIsFun  2 месяца назад

      What does "not working" mean?

    • @HeartistMurali
      @HeartistMurali 2 месяца назад

      It throwing up the message "'xlwings' is not recognized as an internal or external command,
      operable program or batch file."

    • @CodingIsFun
      @CodingIsFun  2 месяца назад

      @@HeartistMurali did you install it?

  • @alializadeh8195
    @alializadeh8195 2 года назад

    Thanx

    • @CodingIsFun
      @CodingIsFun  2 года назад

      You're very welcome! Thank you for watching and for the comment!

  • @asifnaeem7872
    @asifnaeem7872 Год назад

    not working on large data set

    • @CodingIsFun
      @CodingIsFun  Год назад

      How large is your dataset?

    • @asifnaeem7872
      @asifnaeem7872 Год назад

      @@CodingIsFun say 100 thousand record set

    • @CodingIsFun
      @CodingIsFun  Год назад

      @@asifnaeem7872 interesting. I have only tested it with a smaller dataset. Do you get an error message?

    • @asifnaeem7872
      @asifnaeem7872 Год назад

      @@CodingIsFun yes. error like
      #value

  • @tonycooper3410
    @tonycooper3410 2 года назад

    I keep getting error "pip is not recognized"

    • @CodingIsFun
      @CodingIsFun  2 года назад +1

      Have you installed Python and pip?

    • @tonycooper3410
      @tonycooper3410 2 года назад

      @@CodingIsFun worked fine today. Not sure what happened the first 8 times. Thankyou

  • @crouzilles37
    @crouzilles37 Год назад

    pip isn't a recognised command

    • @CodingIsFun
      @CodingIsFun  Год назад +1

      Ensure that you have Python installed, as mentioned in the video

    • @crouzilles37
      @crouzilles37 Год назад

      @@CodingIsFun Thank you, sorry I jumped the gun and should have listened a little more before trying :)

  • @Skbeuker
    @Skbeuker 6 месяцев назад

    Only windows! 😭I’m macOS

    • @CodingIsFun
      @CodingIsFun  6 месяцев назад

      Thanks for watching anyways! Cheers, Sven ✌️

  • @FelipeCampelo0
    @FelipeCampelo0 9 месяцев назад

    Come on ! I need a solution so I can check my queries on any device, not only windows.

    • @CodingIsFun
      @CodingIsFun  9 месяцев назад

      Yes, unfortunately, it is only available for Windows. Nonetheless, thank you for watching. Cheers, Sven ✌️

  • @wiseguy7224
    @wiseguy7224 4 месяца назад

    Du solltest an Deinen Akzent arbeiten. ;-)

  • @dheerajjain5754
    @dheerajjain5754 Год назад

    Thank you this fantastic trick. however, after intalling xlwings and xlwings addin, I am still getting an error. "ImportError: DLL load failed while importing _sqlite3: The specified module could not be found.
    from _sqlite3 import *
    File "C:\Users\Dheeraj.Jain\Anaconda3\lib\sqlite3\dbapi2.py", line 27, in
    from sqlite3.dbapi2 import *
    File "C:\Users\Dheeraj.Jain\Anaconda3\lib\sqlite3\__init__.py", line 23, in
    import sqlite3
    File "C:\Users\Dheeraj.Jain\Anaconda3\lib\site-packages\xlwings\ext\sql.py", line 2, in
    from .sql import sql, sql_dynamic
    File "C:\Users\Dheeraj.Jain\Anaconda3\lib\site-packages\xlwings\ext\__init__.py", line 1, in
    File "", line 219, in _call_with_frames_removed
    File "", line 783, in exec_module
    File "", line 671, in _load_unlocked
    File "", line 975, in _find_and_load_unlocked
    File "", line 991, in _find_and_load
    File "", line 1014, in _gcd_import
    return _bootstrap._gcd_import(name[level:], package, level)
    File "C:\Users\Dheeraj.Jain\Anaconda3\lib\importlib\__init__.py", line 127, in import_module
    module = import_module(module_name)

    • @CodingIsFun
      @CodingIsFun  Год назад

      Thanks. Have a look here: docs.xlwings.org/en/stable/troubleshooting.html

  • @2385boris
    @2385boris 6 месяцев назад

    I am getting a File not found: xlwings64-0.29.1.dll error. plz help

    • @CodingIsFun
      @CodingIsFun  6 месяцев назад

      Have a look here: docs.xlwings.org/en/0.11.6/troubleshooting.html#:~:text=dll%20and%20xlwings64.,pip%20or%20conda%20%2C%20see%20Installation.

    • @2385boris
      @2385boris 6 месяцев назад

      @@CodingIsFun I have tried all this...but worth mentioning I am trying this in my Mac...shall this work in Mac?