how display record from table to gridview on page load and also search record for particular fields using textbox vb.net
Date : March 29 2020, 07:55 AM
I hope this helps you . I assume the variables are set to NULL when not filtered? That would cause the LIKEs to fail, since X LIKE NULL cannot be true. SELECT
a1_admins.EmployeeId, a1_admins.Firstname, a1_admins.Lastname, a1_admins.Email,
a1_admins.City, a1_admins.State, a1_admins.Country, aspnet_Membership.LastLoginDate,
aspnet_Membership.CreateDate, a1_admins.Password, a1_admins.pan_no, a1_admins.Contactno, a1_admins.Address
FROM a1_admins
INNER JOIN aspnet_Membership ON a1_admins.UserId = aspnet_Membership.UserId
WHERE (a1_admins.EmployeeId LIKE N'%' + @EmployeeId + N'%')
OR (a1_admins.City LIKE N'%' + @City + N'%')
OR (a1_admins.State LIKE N'%' + @State + N'%')
OR (a1_admins.Country LIKE N'%' + @Country + N'%')
OR (Coalesce(@employeeid,@city,@state,@country) is null)
|
Update huge record in vertica from impala
Date : March 29 2020, 07:55 AM
it fixes the issue Create table B in Vertica with 20 columns, like in impala. Build a Java program that connects both to impala and Vertica. In that program, bulk read SELECT * FROM impala.B into arrays in memory, and use that same memory as host variables for the target statement INSERT /*+DIRECT */ INTO vertica.B VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?). MERGE /*+DIRECT*/
INTO A t
USING stg_A s
ON s.id = t.id
WHEN MATCHED THEN UPDATE SET
id = s.id
, col02 = s.col02
, col03 = s.col03
, col04 = s.col04
, col05 = s.col05
[...]
, col50 = s.col50
WHEN NOT MATCHED THEN INSERT VALUES (
s.s.id
, s.s.col02
, s.s.col03
, s.s.col04
, s.s.col05
, s.[...]
, s.s.col50
);
|
laravel | Typeahead : How to combine db fields for display and get selected record's id?
Date : March 29 2020, 07:55 AM
I wish this help you The reason you're only getting the first_name is because you're only selecting the first name, select("first_name as name"), remove the select from the query and you'll be returned a collection with all of the fields e.g. $data = customer::where("first_name","LIKE","%{$request->input('query')}%")->orderBy('first_name')->take(6)->get();
$('input.typeahead').typeahead({
source: {
groupName: {
// Ajax Request
ajax: {
url: "{{ route('autocomplete') }}"
}
}
},
callback: {
onResult: function (node, query, result, resultCount, resultCountPerGroup) {
console.log(node, query, result, resultCount, resultCountPerGroup);
}
}
});
|
Impala/SQL How can I put all the orther fields on a group by statement?
Date : March 29 2020, 07:55 AM
wish helps you I have a query grouped by 3 fields against 100 fields table. How can I put the another 97 fields in the select without a join? , Use window functions: select t.*
from (select t.*, max(d) over (partition by a, b, c) as max_d
from mytable t
where d = max_d;
|
Join two tables on id fields using Impala
Tag : sql , By : dyarborough
Date : March 29 2020, 07:55 AM
Any of those help I have two tables in in HDFS that I want to join using Impala. One is Employee_Logs the other is HR_Data. , Probably the safest method is multiple left joins: select el.*,
coalesce(h.name, hv.name, hb.name) as name
from employee_logs el left join
hr_data h
on el.employee_id = h.employee_id left join
hr_data hv
on el.employee_id = concat(h.employee_id, 'v') left join
hr_data hb
on el.employee_id = concat(h.employee_id, 'b');
|