Skip to content
Advertisement

Tag: sql

How to make all combinations with given words in SQL

I’ll make a search query that search on each individual word contains in my table using SQL Server. The query must work as following situation: The query must search in the colour, style, marerial and shape field like an or operator The query must search on each individual search word (like blue, red, modern and wood) with all possible combinations

insert xml data to table stored procedure sql server

I have xml in following format I want to insert them in table so the table should have 4 records in the example. columns are name and alias. How can I achive this using cursor or something else? What i have tried. In cursor for entity i try insert alias value,but only first alias is taken. Answer

Presto – hex string to int

I’m trying to convert hex string (starts with ‘0x’) to it’s integer value using presto. For example 0x100 to 256. My hex string is called msg_id. I tried to use this- But I run into a problem, because from_hex expect even number of hex digits (0100 instead of 100). I decided to try and solve this using an if statement,

SQL If Not Any From Left Join Else Left Join

I the following query and I only want the results from the first left join that returns results for the addresses (add1/2/3). Is it possible, or should I just return it all and filer the results later? For example, if add1 returns 1 address, add2 returns 1 address and add3 returns 3 addresses, I only want the result set from

MySQL 8 create new user with password not working

I am using MySQL for several years and the command for the creating the new user till the MySQL 5.x version is as follow: Recently I installed the MySQL 8. In that, this command is not working. It is throwing following error while firing above command: Is there any change of syntax in MySQL 8? What is the correct syntax

Advertisement