How to query with japanese in bigquery - google-bigquery

I have a problem with querying in Japanese, what should I do?
SELECT current_date() AS 時間;
Error
Invalid field name "時間". Fields must contain only letters, numbers, and underscores, start with a letter or underscore, and be at most 300 characters long.

Currently table names and column names are English-only.
As stated in the documentation:
A column name must contain only letters (a-z, A-Z), numbers (0-9), or
underscores (_), and it must start with a letter or underscore. The
maximum column name length is 300 characters. A column name cannot use
any of the following prefixes: TABLE, FILE, PARTITION. Duplicate
column names are not allowed even if the case differs. For example, a
column named Column1 is considered identical to a column named
column1.
Therefore, other characters including japanese cannot be used as column names.
More info: https://issuetracker.google.com/65034056

Related

how to retrieve data that contains special characters including alphabet

I'm using oracle and hive db engine and supposed that in a varchar column (phone number), I only want to retrieve record with digit and hyphen '-'
i.e. 03-1234 5678
But how if I want to retrieve if column has special chars (except hyphen) and alphabet using like or rlike.
i.e 03-ABC123$#45XYZ or 03-AB123 Y123#& (with space)
Thanks in advance!
Using RLIKE we can try:
SELECT * FROM yourTable WHERE phone RLIKE '^[0-9 -]+$';
This will match only phone numbers consisting of digits, space, or hyphen.

How to split and convert to pascal case oracle column names?

I want to selec column names and convert to pascal case. My column names are like this:
IMG_SAR_NAME
INT_AKT_DESC
I want to split "_" names and convert to:
ImgSarName
IntAktDesc
I can get column names with sql
Select COLUMN_NAME from ALL_COL_COMMENTS WHERE TABLE_NAME="MY_TABLE;
But can not convert to pascalcase.
I don't know if always the underscore is the separator, but if it is, you can do this:
SQL> select replace(initcap('IMG_SAR_NAME'),'_','') from dual ;
REPLACE(IN
----------
ImgSarName
SQL>
The Oracle INITCAP() function sets the first letter of each word in
uppercase, all other letters in lowercase. Words are delimited by
white space or characters that are not alphanumeric. A string whose
first character in each word will be converted to uppercase and the
rest characters will be converted to lowercase.

Including special characters in column names in BigQuery?

Is there in BigQuery a way to include special characters (such as %, white space, periods etc) in column names, resp. can you somehow escape special characters?
In my case it would come in handy when col names would be more readable for example when exporting reports.
No, the rules for field names (and aliases) in BigQuery are:
A column name must contain only letters (a-z, A-Z), numbers (0-9), or
underscores (_), and it must start with a letter or underscore. The
maximum column name length is 300 characters. A column name cannot use
any of the following prefixes: _TABLE_, _FILE_, _PARTITION_.
Duplicate column names are not allowed even if the case differs. For example, a column named Column1 is considered identical
to a column named column1.

Getting the Column containing the non-english language in ORACLE

I have above entries in my database, my requirement is to extract the fields containing the non-english language characters ( including if the data containing the combination of english and non-english characters like HotelName field for the ID 45).
I tried by regexp_like function by looking for the alphanumeric and non-alphanumeric, but i have some data with combination of both the condition fails there.
Thanks in Advance
Raghavan
Does this do what you want?
where regexp_like(hotelname, '[^a-zA-Z0-9 ]')
That is, where the hotel name contains any character that is not a "letter" or digit. You may need to take additional characters into account as well, such as commas, periods, and hyphens.

MSAccess Query a string matching a pattern

I have a table with a string field containing location information. I want to be able to query this table and retrieve all of the tags matching the format xxxxxxAA where xxxxxx is a 6-digit number and AA is two alphabetic characters.
Is there a method of querying this using SQL or is this something that I need to do in VBA?
Sample data:
BGS5 PM RGP5
022051PM
022201PM
030539PM
WAS3N
179546MM
And I want to return the following without knowing the values:
022051PM
022201PM
030539PM
179546MM
thanks in advance
Jason
You can use a query with a Like comparison in the WHERE clause.
SELECT y.text_field
FROM YourTable AS y
WHERE y.text_field Like '######[A-Z][A-Z]'
The # matches a digit.
[A-Z] matches one character from a character class consisting of only letters. That character class is actually upper case letters. However, the comparison is case-insensitive, so will match lower case letters, too.