Этот баннер — требование Роскомнадзора для исполнения 152 ФЗ.
«На сайте осуществляется обработка файлов cookie, необходимых для работы сайта, а также для анализа использования сайта и улучшения предоставляемых сервисов с использованием метрической программы Яндекс.Метрика. Продолжая использовать сайт, вы даёте согласие с использованием данных технологий».
Политика конфиденциальности
|
|
|
Как подставить в Select переменные
|
|||
|---|---|---|---|
|
#18+
Hi! Do you know how to use SQL to make an 'indirection'. You remember in the C language, how you can treat the contents of a variable as a pointer to another variable location, or in other 4th generation languages (& some OS stuff), you can use a 'handle' to hold an indirect reference to another variable... I want to do something similar in SQL. I want a column in a table to hold a string that is a column name. I want to create an SQL statement that will use the value of that column name and perform a comparison. For example, there it a table: Table: T_Compare_Columns ( col_name char(50) ) Another table: Table: T_Datastuff ( name_ch char(20), county_ch char(20), salary_dc decimal ( 12,2) ) Insert a line into T_Compare_columns: Insert into T_Compare_columns values ( 'county_cd' ) Then use that to perform an 'indirect reference' comparison. This statement is pure fiction. I know it will not work in this form: select * from T_Datastuff where T_Compare_column.col_name = T_datastuff.COLUMN_NAME and t_datastuff.COLUMN_NAME = 'RICHLAND' Thank you, Alena ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.11.2001, 15:23 |
|
||
|
Как подставить в Select переменные
|
|||
|---|---|---|---|
|
#18+
There are 3 things in MSSQL to help to solve the task: 1) Operator "EXEC(string_expression)" for executing a dynamic query. 2,3) System tables "syscolumns" and "sysobjects", where there are columns' and tables' names. It is enough. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.11.2001, 07:23 |
|
||
|
|

start [/forum/topic.php?fid=46&tid=1824923]: |
0ms |
get settings: |
6ms |
get forum list: |
9ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
39ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
41ms |
get tp. blocked users: |
1ms |
| others: | 215ms |
| total: | 326ms |

| 0 / 0 |
