<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[dingrutao的博客]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/dingrutao</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; dingrutao]]></copyright><item><title><![CDATA[django实现文件上传、删除、下载]]></title><link>https://blog.csdn.net/dingrutao/article/details/116302190</link><guid>https://blog.csdn.net/dingrutao/article/details/116302190</guid><author>dingrutao</author><pubDate>Fri, 30 Apr 2021 14:16:26 +0800</pubDate><description><![CDATA[django文件上传
定义一个包含FileFiled的类ModelWithFileField，其中upload字段的upload_to参数表示上传的文件存放在什么地方
class ModelWithFileField(models.Model):
    filename = models.CharField(max_length=100, verbose_name="文件名称")
    upload_date = models.DateField(verbose_name='上传日期')
    upl]]></description><category></category></item><item><title><![CDATA[postgresql递归查询获取组织结构]]></title><link>https://blog.csdn.net/dingrutao/article/details/116000616</link><guid>https://blog.csdn.net/dingrutao/article/details/116000616</guid><author>dingrutao</author><pubDate>Thu, 22 Apr 2021 10:03:45 +0800</pubDate><description><![CDATA[postgresql递归查询组织结构
被问到的问题，之前没有使用过，记录一下。问：如果我有一张地区表，列名分别是，地区id,地区名,上级地区id，怎么查询到一个地区所有的上级id
通过postgresql cte公共表达式with语句进行递归查询,参考连接链接: Postgresql递归查询
cte递归语句的用法
WITH RECURSIVE cte_name(
    CTE_query_definition -- 非递归项
    UNION [ALL]
    CTE_query definion  ]]></description><category></category></item><item><title><![CDATA[mysql的行转列]]></title><link>https://blog.csdn.net/dingrutao/article/details/115962916</link><guid>https://blog.csdn.net/dingrutao/article/details/115962916</guid><author>dingrutao</author><pubDate>Wed, 21 Apr 2021 16:45:21 +0800</pubDate><description><![CDATA[sql的行转列
今天去面试，本来准备的东西完全没有问到，全部问的sql基础的东西，很尴尬的没有回答出来。记录一下。有三列数据，一列user，一列科目，一列分数，怎么得到user、科目名称。科目名称下为分数。其实就是考查行转列。
以mysql5.7为列,貌似没有pivot，使用case when吧
表student




user
subject
score




小明
数学
88


小明
语文
77


小明
英语
100


小刚
数学
88


小刚
语文
99


小刚
英语
60


sele]]></description><category></category></item></channel></rss>