getaliasesby command on SQL query [closed] - sql

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
now im investigating SQL Query for making Datawarehouse.
I found this query on it :
MAX(dbo.GetAliasesByWo(b_1.wo_part, b_1.wo__dec01, RTRIM(LTRIM(b_1.wo__chr01)), RIGHT(RTRIM(LTRIM(b_1.wo_rmks)), 1))) AS list_wo,
MAX(dbo.GetAliasesByWo1(b_1.wo_part, b_1.wo__dec01, RTRIM(LTRIM(b_1.wo__chr01)), RIGHT(RTRIM(LTRIM(b_1.wo_rmks)), 1))) AS list_wo1,
MAX(dbo.GetAliasesByWo2(b_1.wo_part, b_1.wo__dec01, RTRIM(LTRIM(b_1.wo__chr01)), RIGHT(RTRIM(LTRIM(b_1.wo_rmks)), 1))) AS list_wo2
did anyone knows whats the meaning ? could you explain to me ?

You can use sp_helptext command to view the definition.I think the given GetAliasesByWo is an user-defined function you can check the definititon with the below query:
EXEC [ServerName].[DatabaseName].dbo.sp_helptext 'dbo.GetAliasesByWo'

Related

A newbie in SQL asking about functions [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 months ago.
Improve this question
How can I find data that dont end with letter 'g' without using NOT LIKE function, please help
select * from table where right(column, 1) != 'g'
Since you asked how to do it using "not like," I'll answer that. The function version provided by #Zoories would be more efficient.
This works at w3schools.com
SELECT * FROM Customers where CustomerName not like '%g';

Need info on string functions in sql [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Could you please help me on this scenario
'Hello World'
i want to print like 'ello World'
what are the possible diff ways to acheive this
Try this:
select substr('Hello World',2) from dual;--Oracle
select substr('Hello World',2);--Mysql
select substring('Hello World',2)--Postgres

i want to execute an sql query in ruby to use the result to make some tests in my views [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
this is the query :
SELECT COUNT(*)
FROM public.member_roles , public.members , public.users
WHERE public.users.id = public.members.user_id AND public.members.id = public.member_roles.member_id AND public.member_roles.role_id = 4 ;
in my views if this query return 1 , a text area is ganna be disabled
in rails
ActiveRecord::Base.connection.execute(your_sql_here)
you can find more info on this question. Hope this help you.
this will return Mysql2::Result object (if you are using mysql db and mysql2 gem. I belive for PG also it give similar object. to fetch data from it. here is a docs for Mysql2::Result.

Sql code to create the Mirror image of the string in Oracle sql [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
Team,
I need a sql query or function which will create the mirror image of string.
Thanks
Rajeev
If "mirror" is reversed text use:
SELECT REVERSE('my_text') FROM dual;
EDIT:
SqlFiddleDemo
SELECT t
,REVERSE(t) AS Mirror1
,TRANSLATE(t, 'abcdefghijklmnopqrstuvwxyz',N'ɐqɔpǝɟbɥıظʞןɯuodbɹsʇnʌʍxʎz') AS Mirror2
,TRANSLATE(REVERSE(t), 'abcdefghijklmnopqrstuvwxyz',N'ɐqɔpǝɟbɥıظʞןɯuodbɹsʇnʌʍxʎz') AS Mirror3
FROM tab;

drop everything to the right of a hyphen in sql [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I am using Oracle SQL developer 2012. My data looks like 'valueA-valueB'. I want to strip the content after - and populate with rest.
You can use a combination of substr and instr:
SELECT SUBSTR(my_column, 1, INSTR(my_column, '-') - 1)
FROM my_table