45 reputation
4
bio website
location
age
visits member for 2 years, 4 months
seen May 1 at 9:50

Drupal Developer, PHP programmer


Nov
15
comment MySQL check duplicate with group by using wildcard?
I am curious about the IF conditions in your SQL. Will it work faster since it reduce another condition "OR"? IF(LENGTH(A.name)>LENGTH(B.name), INSTR(A.name,B.name)>0, INSTR(B.name,A.name)>0)
Nov
15
comment MySQL check duplicate with group by using wildcard?
I think add a group by should solve the duplicate for Leigh's answer. SELECT A.*, IF(B.ID IS NULL, "", "DUP") as DUP FROM persons A LEFT JOIN persons B ON a.ID <> b.ID AND (Instr(a.Name, b.Name) > 0 OR Instr(b.Name, a.Name) > 0) GROUP BY a.ID ORDER BY ID;
Nov
15
comment MySQL check duplicate with group by using wildcard?
Thanks @LeighRiffel. It helps me a lot.
Nov
15
accepted MySQL check duplicate with group by using wildcard?
Nov
14
revised MySQL check duplicate with group by using wildcard?
added 229 characters in body
Nov
14
comment MySQL check duplicate with group by using wildcard?
'Muffy Lee' and 'Muffy John' is not duplicate because they have different name, unless there is another row of data which name as 'Muffy' only.
Nov
14
revised MySQL check duplicate with group by using wildcard?
added 127 characters in body
Nov
14
comment MySQL check duplicate with group by using wildcard?
Thank you. If the full name appear in another row, then I will consider it as duplicate. So Hardik will be duplicate to 'Jass Hardik', 'Hardik Jass', 'Hardik M. Jass', 'Hardik Jass Muffy'
Nov
14
comment MySQL check duplicate with group by using wildcard?
The reason I plan to do this was just to inform admin that the entry might be duplicate. My system should not prevent user to type what ever name they want. Because some of the user might have similar name. Anyway thank you and I really appreciates for your advice.
Nov
14
comment MySQL check duplicate with group by using wildcard?
You mean we should done the validation before running INSERT SQL?
Nov
14
asked MySQL check duplicate with group by using wildcard?
Apr
28
awarded  Supporter
Apr
28
awarded  Scholar
Apr
28
accepted barcode inventory design - transaction or master?
Apr
27
comment barcode inventory design - transaction or master?
Please ignore the above explanation. 1 product have 0 or many barcode 1 barcode belongs to 1 product 1 product have 0 or many qty 1 barcode have 1 or many qty Some product qty might be depends on qty of barcode. Some product which doesn't have barcode, so qty is depends on number of goods left. Hope I didn't sound complicated.
Apr
27
comment barcode inventory design - transaction or master?
Thank you, great idea. I will follow your method. but I still have little bit problem with the qty. product, barcode, qty. 1 product have 0 or many barcode 1 barcode belongs to 1 product 1 product have 0 or many qty 1 barcode have 1 or many qty Some product qty might be depends on qty of barcode Some product qty might not have barcode
Apr
26
awarded  Editor
Apr
26
revised barcode inventory design - transaction or master?
added 26 characters in body
Apr
26
awarded  Student
Apr
26
asked barcode inventory design - transaction or master?