Questions tagged [SQL] (4020)

2
answers

In MS SQL SMS 2008 R2 Express to watch the objects of MS SQL Server 2000 is similar to viewing them in QA?

Unfortunately, SMS 2008 R2 Express refuses to show the database objects SQL 2000, citing the lack of rights to sysusers. The administrator is not eager to give the right to select. Is it possible to add functionality to the environment SMS 2008 to work with database SQL 2000 in the Object Explorer same as the standard Query...
Tyre asked October 14th 19 at 12:01
1
answer

How to get rid of duplicate joins s at the intersecting ForeignKey in Django?

Noticed one unpleasant thing. Suppose there is a model that linked the other two have the same ForeignKey.class File(models.Model):<br> #some stuff<br> pass<br> <br / > class ServerFile(models.Model):<br> <b>file = models.ForeignKey('File')</b><br> #some stuff<br> <...
Darion.Daniel asked October 14th 19 at 11:33
4
answers

[SQL] to Check whether one date range to another

Good afternoon. Please help me to create SQL query. There are two dates. You need to check that the interval between these data does not fall in the date interval in the database table. And also that date range in the table falls in the interval between these dates.
alden7 asked October 14th 19 at 10:34
2
answers

SQL query for fetching attributes of the current entity from a table magazine type

There is a table that stores attributes of entities, such as a product identifier, price and date of the last update. When you add new prices to the table, a row is inserted ('id-product', 'new price', 'add'). How to obtain a sample with current prices for all goods?
Sophie92 asked October 14th 19 at 10:31
5
answers

Query with Union in MySQL

There is a database with two tables users (user_id, email, password, user_type) and user_profiles (user_id, profile_key, profile_value). Stored in them, respectively, the primary user and secondary data (gender, phone, address, etc.) Need to make their Union funds only SQL, so that the output is to have one array like: arra...
Allie24 asked October 10th 19 at 15:05
2
answers

Question about collations in MySQL?

Have a table with the following structure: It contains the following data: Do experimental query:SELECT<br> LOWER(`md5_upper_bin`),<br> LOWER(`md5_upper_ge_ci`),<br> UPPER(`md5_lower_bin`),<br> UPPER(`md5_lower_ge_ci`) <br> FROM `qwew` The result:Question: why Postfix _bin these fields is ignor...
Adrienne.Aufderh asked October 10th 19 at 14:57
6
answers

The query in MySQL

I have a query that calculates a value using CASE, for example: SELECT (CASE WHEN a.id > 500 THEN a.id ELSE a.id + 500 END) as new_column FROM table a; How to use the value of new_column to calculate another value? I.e. something like: SELECT (CASE WHEN a.id > 500 THEN a.id ELSE a.id + 500 END) as new_column, (CASE...
Ike.Koss asked October 10th 19 at 13:47
3
answers

SQL query [MySQL] optimize?

Hi all, I have probably two questions 1. where can I read about how to actually perform the queries in MySQL? the thing that used to be clear which places are narrow, you want to understand in what order and by what rules it all happens For example if I have a query of the form SELECT DISTINCT s.c_id as c_id ,( SELECT IF...
delaney.Koelp asked October 10th 19 at 12:45
3
answers

SQL UPDATE with regular expressions

There are in the table of strings like '123abc', '123bcd'. They need samnite part of a string (e.g. '123') to another string (such as '345'), but so that the second part remained in place. And this is one request on many, many rows. Ie, the regular season would look like this: var input = '123abc'; var replaceText = '345$1...
Trenton.Cri asked October 10th 19 at 12:43
5
answers

Oracle SQL, PL/SQL

In order to successfully pass an interview at a firm where I really want to get, I need to brush up on SQL. Specifically — Oracle SQL and PL/SQL. Advise the literature on this topic. The current state of knowledge — can write a simple query. No depth. Thanks for the replies.
sandra asked October 10th 19 at 12:29